Skip to content

This is starter project for Nest.js, MongoDB and Docker. You can easily start your production ready containered project by forking this repo.

License

Notifications You must be signed in to change notification settings

Aaqib925/Nest-Mongo-Docker-Api

Repository files navigation

Nest-Docker-Mongo API Example 🔥.

Installation

$ npm install

Set environment

$ cp .env.example .env

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Docker

There is a docker-compose.yml file for starting MongoDB with Docker.

$ docker-compose up

After running, you can stop the Docker container with

$ docker-compose down

Url Swagger for Api Documentation

http://127.0.0.1:3000/api/doc

Getting with Curl Users

    $ curl -H 'content-type: application/json' -v -X GET http://127.0.0.1:3000/api/users  
    $ curl -H 'content-type: application/json' -v -X GET http://127.0.0.1:3000/api/users/:id 
    $ curl -H 'content-type: application/json' -v -X DELETE http://127.0.0.1:3000/api/users/:id 

Getting Pagination using limit and offset

    $ curl -H 'content-type: application/json' -v -X GET http://127.0.0.1:3000/api/users?limit=10
    $ curl -H 'content-type: application/json' -v -X GET http://127.0.0.1:3000/api/users?offset=10
    $ curl -H 'content-type: application/json' -v -X GET http://127.0.0.1:3000/api/users?limit=10&offset=0

About

This is starter project for Nest.js, MongoDB and Docker. You can easily start your production ready containered project by forking this repo.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published