step by step for configuration with docker
OBS: required docker and docker-compose
-
cp -r .env.sample .env
-
docker-compose up
- method:
POST
- statusCode:
201
- endpoint:
http://localhost:3001/api/books
body
{
"name": "De zero a Um",
"description": "O que aprender sobre empreendedorismo com o vale do silicio",
"author": "Peter Thiel e Blake Masters",
"status": "pending",
"url": "https://url-fake/img.png"
}
response
{
"id": "624e2085a25ae260f044098a",
"name": "De zero a Um",
"description": "O que aprender sobre empreendedorismo com o vale do silicio",
"author": "Peter Thiel e Blake Masters",
"status": "pending",
"url": "https://url-fake/img.png",
"createdAt": "2022-04-06T23:21:41.216Z",
"updatedAt": "2022-04-06T23:21:41.216Z"
}
- method:
GET
- statusCode:
200
- endpoint:
http://localhost:3001/api/books
response
[
{
"id": "624e2085a25ae260f044098a",
"name": "De zero a Um",
"description": "O que aprender sobre empreendedorismo com o vale do silicio",
"author": "Peter Thiel e Blake Masters",
"status": "pending",
"url": "https://url-fake/img.png",
"createdAt": "2022-04-06T23:21:41.216Z",
"updatedAt": "2022-04-06T23:21:41.216Z"
}
]
- method:
GET
- statusCode:
200
- endpoint:
http://localhost:3001/api/books/:_id
response
{
"id": "624e2085a25ae260f044098a",
"name": "De zero a Um",
"description": "O que aprender sobre empreendedorismo com o vale do silicio",
"author": "Peter Thiel e Blake Masters",
"status": "pending",
"url": "https://url-fake/img.png",
"createdAt": "2022-04-06T23:21:41.216Z",
"updatedAt": "2022-04-06T23:21:41.216Z"
}
- method:
PUT
- statusCode:
200
- endpoint:
http://localhost:3001/api/books/:_id
body
{
"url": "https://url-fake.com/img.png"
}
response
{
"_id": "624e2085a25ae260f044098a",
"name": "De zero a Um",
"description": "O que aprender sobre empreendedorismo com o vale do silicio",
"author": "Peter Thiel e Blake Masters",
"status": "pending",
"url": "https://url-fake.com/img.png",
"createdAt": "2022-04-06T23:21:41.216Z",
"updatedAt": "2022-04-06T23:21:41.216Z",
"__v": 0
}
- method:
DELETE
- statusCode:
200
- endpoint:
http://localhost:3001/api/books/:_id
response
{
"message": "Book deleted with successfully"
}
Next step:
- add nginx for proxy reverse
- add authentication with JWT
- add routes authenticated
- add makefile for automatization commands
- add AWS S3 for Upload files
- add Redis for cache some endpoints
- add cron job
- add queue with bull
- add rate limiting
- add logging
- add logs module
- add GraphQL
- add file procfile for deploy heroku
Made with 🖤 by williamkoller 👋