Node server for rails application
Install node.js. You can use Node Version Manger for this.
Next install Node Package Manager
Install required packages:
npm install
Run node server:
node server.js
To run specs from rails app you need to run node:
REDIS_DB=1 PGS_PORT=3666 node server.js
REDIS_DB should be number that you specified in config/redis.yml in rails app test group.
You can update node packages by changing versions in package.json file and running:
npm update
It's possible to run node server on heroku.
To have your own instance on heroku:
- Install heroku client
gem install heroku
- Create application
heroku create --stack cedar my-peergroup-node-app-name
- Setup configuration variables
heroku config:add PGS_HOST=example.com PGS_PORT=80 PGS_USERNAME=node PGS_PASSWORD=secret REDISTOGO_URL=redis.url
- PGS_HOST - address of rails application
- PGS_USERNAME/PGS_PASSWORD - credentials for connecting to rails app
- REDISTOGO_URL - redis url taken from rails app
- Deploy code
git push heroku master
- Run web process
heroku ps:scale web=1
Refer to heroku docs for more informations.
MIT License. Copyright © 2011 Wolfgang Ihloff