npm install restfuljs -g
restfuljs --help
restfuljs app --help
restfuljs app -d myTestApi -w 'users, projects'
restfuljs add profiles
You can easily bootstrap data into the application by running node app --bootstrap
from the application directory. This will clear the database and load data from a json
file in the data
directory for each of the resources.
quick and easy restful responses for expressjs apps
npm install restfuljs
add to express app middleware:
app.use(require('restfuljs').response);
as direct callback to mongoose query:
models.user.findById(id, res.tful);
another mongoose query callback example:
user.save(res.tful);
manual call:
res.tful(error, result)