Challenge proposed by DNC to create an API that allows users to store, edit and remove books. It connects with the front-end repo provided by the teacher.
Front-end Repo. => LINK
- Node.js
- Express
- MongoDB
- Mongoose
GET localhost:3000/livros
GET localhost:3000/livros/:id
Parameter |
Type |
Description |
id |
string |
Mandatory. The ID Of the book you are searching. |
POST localhost:3000/livros
Parameter |
Type |
Description |
id |
string |
Mandatory. The ID Of the book you are creating. |
titulo |
string |
Mandatory. The Title of the book you are creating. |
num_paginas |
number |
Optional. The number of pages of the book you are creating. |
isbn |
string |
Optional. The ISBN code of the book you are creating. |
editora |
string |
Optional. The editor of the book you are creating. |
PUT localhost:3000/livros/:id
Parameter |
Type |
Description |
id |
string |
Mandatory. The ID Of the book you are creating. |
titulo |
string |
Optional. The Title of the book you are creating. |
num_paginas |
number |
Optional. The number of pages of the book you are creating. |
isbn |
string |
Optional. The ISBN code of the book you are creating. |
editora |
string |
Optional. The editor of the book you are creating. |
DELETE localhost:3000/livros/:id
Parameter |
Type |
Description |
id |
string |
Mandatory. The ID Of the book you are deleting. |
After cloning or downloading the project, use the commands below in the terminal.
Make sure you have "Nodemon" installed in your computer.
npm install my-project
cd my-project
npm i nodemon -g
npm run dev