if (FALSE) {
pr() %>%
pr_handle("GET", "/hi", function() "Hello World") %>%
pr_run()
pr() %>%
pr_handle(c("GET", "POST"), "/hi", function() "Hello World") %>%
pr_run()
pr() %>%
pr_get("/hi", function() "Hello World") %>%
pr_post("/echo", function(req, res) {
if (is.null(req$body)) return("No input")
list(
input = req$body
)
}) %>%
pr_run()
}
Run the code above in your browser using DataLab