This api will be used in my personal project and is only for studies.
- Important - You must have docker and docker-compose installed. Following the guide install docker in docker-guide
$ npm i yarn -g
$ yarn
To start the api you need to build the infrastructure first.
$ sudo apt install make
$ cd infrastructure/
$ make up
To create the database start the migrations. First make sure you're in the root of the projec.
$ yarn sequelize-cli db:migrate
$ yarn sequelize-cli db:seed:all
This endpoint is responsible for logging into the api.
Email and Passoword
{
"email": "example@example.com",
"password": "example1"
}
This endpoint lists all registered books
None
[
{
"id": 1,
"title": "JavaScript",
"pages": 400,
"release": "10-01-01T00:00:00.000Z",
"category_id": 1,
"active": true,
"image_id": 1,
"Category": {
"id": 1,
"name": "Technology"
},
"Image": {
"id": 1,
"originalname": "example.jpg",
"filename": "1644196162780exmple.jpg",
"url": null,
"createdAt": "2022-02-07T01:09:22.000Z",
"updatedAt": "2022-02-07T01:09:22.000Z"
}
}
]
This endponit searches for a book according to the id passed in the parameter
Query params: Id