ToDo Rest Api that creates, changes, lists, and deletes tasks.
It is necessary to install the PostgreSQL database before installing the application. This tutorial can help you.
Clone the repository and install the dependencies
git clone [email protected]:kellina/todo-api-rest.git
cd todo-api-rest
npm install
Create a .env
file at the root of the project with the following environment variables:
DATABASE_URL= postgres://dbuser:password@localhost:port/dbname
PORT=8080
Start the application with:
npm start
- Download the database startup script database.sql
- Create the
docker-compose.yml
file as in the example below in the same directory as thedatabase.sql
file downloaded in the previous step.
version: "3.7"
services:
db:
image: postgres:13.1-alpine
restart: always
environment:
POSTGRES_PASSWORD: todo
volumes:
- ./database.sql:/docker-entrypoint-initdb.d/database.sql
backend:
image: kellina/todoback:latest
environment:
- DATABASE_URL=postgres://postgres:todo@db:5432/todo
- PORT=8080
depends_on:
- db
ports:
- 8080:8080
- Run the command
docker-compose up
The swagger documentation for this application is at: http://localhost:8080