Skip to content

kellina/todo-api-rest

Repository files navigation

Todo-api-rest

GitHub npm version Heroku App Status Build Status codecov Quality Gate Status Security Rating Docker Automated build

ToDo Rest Api that creates, changes, lists, and deletes tasks.

Install

Manual

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

Docker container

  1. Download the database startup script database.sql
  2. Create the docker-compose.yml file as in the example below in the same directory as the database.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
  1. Run the command docker-compose up

Swagger

The swagger documentation for this application is at: http://localhost:8080

Swagger

About

ToDo Rest Api that creates, changes, lists, and deletes tasks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published