# NOT RUN {
# Create an new Beakr instance
beakr <- newBeakr()
# Create a pipeline of hanldlers
beakr %>%
httpGET(path = "/route_A", function(res, req, err) {
print("This is route 'A'.")
}) %>%
httpGET(path = "/route_B", function(res, req, err) {
print("This is route 'B'.")
}) %>%
handleErrors() %>%
listen(host = '127.0.0.1', port = 25118, daemon = TRUE)
# ------------------------------------------------------------
# POINT YOUR BROWSER AT:
# * http://127.0.0.1:25118/route_A
# * http://127.0.0.1:25118/route_B
# ------------------------------------------------------------
# Stop the beakr instance server
stopServer(beakr)
# }
Run the code above in your browser using DataLab