Implementing sample CRUD (crate, read, update, delete) operations.
$> npm install
$> mkdir items
$> cd items
$> mongod --dbpath .
$> npm start
Now that we have a server running on localhost:3000
we can make some requests.
$> curl -X POST -H 'Content-Type: application/json' \
-d '{"name": "Item 1", "desc": "This is the first item.", "amount": "4"}' \
localhost:3000/items
$> curl localhost:3000/items
$> curl localhost:3000/items/<item _id here>
$> curl -X PUT -H 'Content-Type: application/json' \
-d '{ "name": "New item name" }' \
localhost:3000/items/55635c38735bb3121a59ccc5
$> curl -X DELETE localhost:3000/items/55635c38735bb3121a59ccc5