I want to create a small web service and for that I really want to use node.js and express.
I already have an Apache running on my little server (it's a Raspberry PI :P ) which receives all the traffic. How can I configure a VirtualHost to be served by node.js?
I searched a lot and I found many solutions, namely:
- Use ProxyPass to forward requests from Apache to node.js
- Use Rewrite rules in .htaccess file
- Use VPS
But all these solutions require a running daemon for node.js and resources are scarce on Raspberry PI (it only has 256MB of RAM). So I searched a bit more and I found this solution:
GGI-Node provides the ability to run JavaScript on any web server just like PHP as a CGI using Node.js.
But again, this solution doesn't fulfill my requirements. GGI-Node is more of an adaptation of node.js to PHP and it's not possible to use with/like express.
So I came up with an idea: what about modifying express to keep the same behavior and functionality and, instead of creating a server, feeding express with info from Apache via CGI? I searched even more and I didn't find anything like that... Is this possible to do? How hard would it be to implement?
I know this solution doesn't take the advantages of node.js asynchronous I/O, but it's not important in my case.