- Handle CRUD for an item (let's use Dino for the case)
- CORS settings
- Full-Text Search
- Use standard URLs (http://example.com/api/dinos and http://example.com/api/dinos/:dino_id)
- Use the proper HTTP verbs to make it RESTful (GET, POST, PUT, and DELETE)
- Return JSON data
- Use ES6 promises
- Log all requests to the console
- HTTP and HTTPS support
Route | HTTP Verb | Description |
---|---|---|
/api/bears | GET | Get all the bears. |
/api/bears | POST | Create a bear. |
/api/bears/:bear_id | GET | Get a single bear. |
/api/bears/:bear_id | PUT | Update a bear with new info. |
/api/bears/:bear_id | DELETE | Delete a bear. |
node -v
- v6.x.x
npm -v
- 3.x.x
- mongodb - MongoDB (mLab free sandbox service) based sample. See mongodb/README.md for details.