YHat and Domino Data Labs both have commercial solutions for exactly this.
On the open-source front, OpenCPU (https://www.opencpu.org/), Jug (http://bart6114.github.io/jug/) or plumber (http://plumber.trestletech.com/) are all built for this. Plumber has a page to guide you through setting it up on a server using PM2 here: http://plumber.trestletech.com/docs/hosting/
(Conflict of interest warning: I wrote plumber.)
I've been running an API on plumber (with admittedly low volumes of traffic) for months now unattended using a strategy similar to the guide mentioned above. Haven't had any issues yet.