Closed tconwell closed 3 years ago
You should be able to do something like this:
while(TRUE) {
httpuv::service()
}
You can of course substitute the TRUE
with some other condition for exiting the application. As written, you would need to interrupt the application with Ctrl-C.
Oh, I also just remembered that you can simply use runServer()
instead of startServer()
, and it will run the application and the process will stay alive. If you call runServer()
, you'll have to send an interrupt to exit the application.
Using RScript to run a script that starts a server using startServer() will start the server and immediately end the R session when done, thereby killing the server. Is there a way to start a server with httpuv and RScript that both returns and doesn't immediately kill the server after creating it?