I am trying to integrate some node.js code with my Rails application. Basically its a js file with some code that process will keep running in background.
I have followed the following steps:
- Added code in root of rails app in some test_node.js file.
- Now what I do is pass a value to my system using exec function of ruby, e.g exec "node test_node.js".
- This works perfectly fine but it chop my server from processing any requests.
- To pass it to background i tried using nohup e.g: exec "nohup node test_node.js".
- When I run this code my server crashes.
I am Rails developer and never worked on node app so have no idea if I taking it right way or not.