API in Fastify, Postgres and Docker. Responsible for task management (CRUD).
This is a simple project, intended to demonstrate a basic CRUD, without business rules.
Clone this project
git clone https://github.com/itallonet/api-todoEnter the project directory
cd api-todoRun docker (to upload the database)
docker compose up -dInstall dependencies
npm installPerform database configuration with Prisma
npx prisma generateIf you face any problem then run this
npx prisma migrate dev --name initStart the server
npm run devNow, use the URL http://localhost:9140 according to the documentation.
You can use the insomnia-schema.json file to have the collection of requests in your hands at once.
GET /:size/:page| Parameter | Type | Description |
|---|---|---|
size |
number |
Required. Number of records you want to return |
page |
number |
Required. Page number |
POST /| Parameter | Type | Description |
|---|---|---|
Name |
string |
Required. Task name |
PUT /| Parameter | Type | Description |
|---|---|---|
ID |
number |
Required. Task identification |
Name |
string |
Required. Task name |
Done |
boolean |
Required. Identifies whether the task was completed (True) or not (False) |
DELETE /| Parameter | Type | Description |
|---|---|---|
ID |
number |
Required. Task identification |