Basic RESTful api for ecommerce where you can add/delete your item and add item to cart after authorization.
- Built a REST Api in Node.js using MVC approch using Nest.js + MongoDB.
- JWT for Authetication and Authorization.
- Node.js 6.11.2
- MongoDb
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
App should now be running on localhost:5000
Swagger API documentation should now be running on localhost:5000/api
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Routes | Description |
---|---|
GET/items/ |
Get list of all items |
POST/items/ |
Post a new item |
GET/items/{itemId} |
Get details of a particular item. |
PATCH/items/{itemId} |
Update a particular item |
DELETE/items/{itemId} |
Delete a particular item |
Routes | Description |
---|---|
POST/user/signUp |
Sign up a new user |
POST/auth/login |
Login a user |
Routes | Description |
---|---|
GET/cart/{userId} |
Get cart detail of a user |
POST/cart/addItem |
Post a new item to cart |
POST/cart/removeItem/{itemId} |
Post remove a particular item from cart |
(Nest + mongo) with Docker compose
npm run init
Visit your browser in: http://localhost:5000/