This example was adapted from the RESTful tutorial: build a restful api using node and express 4
It covers the basics of Mebo's RESTful support: Mebo.restful
- Node 8 or greater
- Express 4 or greater
- Mongodb 3 or greater
git clone https://github.com/meboHQ/example-restful-using-express-mongodb.git
cd example-restful-using-express-mongodb
npm install
Running through the command-line:
node . --help
All
node . bear.all --help
Create
node . bear.create --help
Delete
node . bear.delete --help
Get
node . bear.get --help
Update
node . bear.update --help
Running through the web:
NODE_ENV=development node .
All
GET: http://localhost:8080/api/bears
Create
POST: http://localhost:8080/api/bears
Delete
DELETE: http://localhost:8080/api/bears/:id
Get
GET: http://localhost:8080/api/bears/:id
Update
PUT: http://localhost:8080/api/bears/:id
Mebo is free software; you can redistribute it and/or modify it under the terms of the MIT License