A seed project for building out a new api. Supports resource-based routing, Sequel Models, Redis caching, TESTING, and clustering out of the box.
- nvm install 0.10.26
- npm install -g mocha grunt-cli
- npm install
- edit /conf/development.js && /conf/test.js database information appropriately
- createdb api_dev ; createdb api_test
- nvm use
- npm test
- npm start
- optionally, run 'grunt watch' for JSHint results on saves
- Node.js ≥ 0.10.22
- Postgres
- Redis (production only)
- SIGINT - graceful shutdown
kill -s SIGINT (process_id)
- SIGUSR2 - Rolling restart. Useful for reloading configuration without downtime.
kill -s SIGUSR2 (process_id)
Api Starter uses Sequelize's built in migration support. Docs here
node_modules/sequelize/bin/sequelize -m --url postgres://uname:pass@localhost:5432/api_dev
IMPORTANT do NOT use the global sequelize binary ie) sequelize -m
. Use the binary installed locally to the node_modules folder.
The default grunt task generates documentation using APIDoc.