Skip to content

luc-ribeiro/todo-api-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To do list API


Clique aqui para ver a versão em Português.

💻 Project

The project consists of a REST API for creating, reading, updating, and deleting "To dos".

🚀 Technologies

  • Node.js
  • Express
  • TypeScript
  • PostgreSQL
  • Sequelize

🔖 Preview

preview

Database Table

banner


📄 How to use

Clone this repository:

  $ git clone https://github.com/luc-ribeiro/nodets-todo-api.git

Install the dependencies:

  # with npm
  $ npm install

  # with yarn
  $ yarn install

Create a .env file at the root of the project

In this file, define the following settings:

PORT=PortNumberWhereTheApplicationWillRun

PG_DB=DatabaseName
PG_USER=DatabaseUserName
PG_PASSWORD=UserPassword
PG_PORT=DatabasePortNumber

Create a table in the Database named todos

Run the command:

  # with npm
  $ npm run start-dev

  # with yarn
  $ yarn start-dev

Using the routes

After defining the port number in the .env file:

GET localhost:PortNumber/todo → Lists the To Dos registered in the Database.

POST localhost:PortNumber/todo → Registers a To Do, you need to inform the title in the request Body, which will be the name of the To Do.

PUT localhost:PortNumber/todo/:id → Updates the To Do with the informed ID. It is necessary to inform the title in the request Body.

DELETE localhost:PortNumber/todo/:id → Deletes the To Do with the informed ID.

About

A Todo API list built with Node.js, TypeScript, Sequelize and Express.

Topics

Resources

Stars

Watchers

Forks

Contributors