library(httpuv)
library(RserverPkg)
say_hello <- function(req_info){
query_lst <- req_info$query_list
name <- query_lst[["name"]]
return (paste0("Hello ", name))
}
route <- RserverPkg::Route$new(
path = "/say_hello",
handler = say_hello,
content_type = "text/plain"
)
say_hello_server <- RserverPkg::Server$new(
index_path = NULL,
port = 5555,
routes = c(route)
)
say_hello_server$start()
say_hello_server$list_servers()
say_hello_server$stop()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.