- Nest
- MongoDB
- Docker
-
Clone the repo
-
Exec with
yarn install
-
You must need already have CLI installed:
npm i -g @nestjs/cli
-
Up Database with
docker-compose up-d
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
{{API_URL}} = http://localhost:{your_port}/api/v1/
as GET method:
{{API_URL}}/clients/
//This will return all clients
as GET method
{{API_URL}}/clients/:id
//id must be a valid mongo id
as POST method:
{{API_URL}}/clients/
//data
{
name: "Bob", //string, required
email: "bob@email.com", //string, required
company: "Microhard", //string, required
phone: "123456", //string, optional
notes: "Is my most important client" //string, optional
}
as PATCH method
{{API_URL}}/clients/:id
//id must be a valid mongo id
//new data
{
//ALL VALUES CAN BE optional
name: "Bob update", //string, optional
email: "bob@email.com", //string, optional
company: "Microsoft", //string, optional
phone: "123456", //string, optional
notes: "Hello World" //string, optional
}
as DELETE method
{{API_URL}}/clients/:id
//id must be a valid mongo id