s <- Rhttpd$new()
if (FALSE) {
s$start(quiet=TRUE)
}
s$add(name="response",
app=function(env){
req <- Request$new(env)
res <- Response$new()
res$write('hello')
res$finish()
}
)
if (FALSE) {
s$browse('response') # Opens a browser window to the app.
}
s$remove(all=TRUE)
rm(s)
Run the code above in your browser using DataLab