gfestari/atmuy — pull request #13 by gfestari (2014-08-10 23:40:03+00:00)
Title: Refactor into REST API

Backend API

- Move api into a separate Router.
- Update API to respond with `200`, `400`, `404` and `500` status when applicable.

Add route-specific middleware

- Load document if request includes `:uid` param
- Validate request body params for POST and PUT requests

Update tests and dependencies

Add #beforeEach and #after hooks for DB setup and teardown.

Refactor ATM model

Validates entities before DB insertion

- Update Atm model CRUD ops
- Add Atm#validate method for domain objects
- Export revalidatior Schema for modularity
- Extract DB into `config.js` helper
- Add helpers for Atm instance/class (getByUuid, remove, save, update)

Upgrade dependencies

- Upgrade `gulp-clean` to rimraf
- Add redis and hiredis for session storage
- Add chai-datetime for UpdatedAt/CreatedAt property comparison

Misc

- Update Makefile PHONY defs
- Add Slack config
- Update Makefile targets

- Update bodyParser initialization on app

Update Travis settings

Start a mongoDB instance on boot.

Fix wrong exit status for tests

Runing `gulp test` reported the wrong exit code for failing tests (always 0).
As a workaround, call Makefile's `test` target instead.

Update JSHint prefs

Use node best practices' [recommendations][1]

[1]: https://github.com/felixge/node-style-guide#nodejs-style-guide