Skip to content

Files

Latest commit

f1c4de1 · Jul 13, 2014

History

History
60 lines (45 loc) · 1.74 KB

README.md

File metadata and controls

60 lines (45 loc) · 1.74 KB

API Starter

A seed project for building out a new api. Supports resource-based routing, Sequel Models, Redis caching, TESTING, and clustering out of the box.

Getting Started

  • 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

Dependencies

Signals

  • SIGINT - graceful shutdown
kill -s SIGINT (process_id)
  • SIGUSR2 - Rolling restart. Useful for reloading configuration without downtime.
kill -s SIGUSR2 (process_id)

Migrations

Api Starter uses Sequelize's built in migration support. Docs here

Running

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.

Docs

The default grunt task generates documentation using APIDoc.