Created
May 30, 2012 15:57
-
-
Save gprasant/2837203 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(Rook) | |
# to install Rook, which makes it possible to run R as a server, | |
# R -q -e "install.packages('Rook', repos='http://cran.r-project.org')" | |
app <- function(env){ | |
req <- Rook::Request$new(env) | |
res <- Rook::Response$new() | |
res$write(42) | |
res$finish() | |
} | |
s = Rhttpd$new() | |
s$add(app = app, name = "helloworld") | |
s$start(port=8888) | |
while(T){ | |
Sys.sleep(10000) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment