It's a simple NodeJS API builded to follow the Rockeseat Starter NodeJS course. This API uses MongoDB as database storage.
OBS.: This API was builded on Arch Linux system.
- Express.js
- Cors
- Mongoose
- Mongoose Paginate
- Nodemon - development dependency
- Assuming you alread had Docker installed and configured as well:
# download MongoDB from Docker Hub
docker pull mongo
- Start up a database:
docker run -p 27017:27017 -d mongo
yarn install
yarn dev
Will be running on 3001
localhost port.
I've been used HTTPie to test this application.
# return all records
http get :3001/api/products
# return a especific record by id
http get :3001/api/products/mongodb_id_hash
http post :3001/api/products <<<'{"title":"Product Title","description":"A sample description","url":"https://example.com"}'
http put :3001/api/products/5ea81386864664beec2226ba <<<'{"title":"Change Title"}'
http delete :3001/api/products/5ea81386864664beec2226ba
- Unit Tests
- Integration Tests