/apiToDo

Primary LanguageTypeScript

Api To-Do List

This project was aimed more at applying basic concepts that can guide you or even give you a 'north' where you could start. I would also like to thank @Yago for challenging me to achieve this goal, making it possible for me to apply these concepts in the best way possible.

Features

  • Create Tasks
  • Update existing Tasks by ID
  • Get all Tasks's
  • Get Tasks by ID
  • Delete Tasks by ID

Frameworks

Express

Jest

API Reference

READ all tasks

  • GET /tarefas
Parameter Type Description
api_key string Required. Your API key

curl http://localhost:{$PORT}/tarefas

READ task

  • GET /tarefas/{ID}
Parameter Type Description
id number Required. Id of item to fetch

curl http://localhost:{$PORT}/tarefas/{id}

CREATE task

  • POST /tarefas
Parameter Type Description
titulo string Required. title of the item to be created

curl -X POST -H "Content-Type: application/json" -d '{"titulo": "Nova Tarefa"}' http://localhost:{$PORT}/tarefas

UPDATE task

  • PUT /tarefas/{ID}
Parameter Type Description
id number Required. Id of item to fetch
title number Required. tTitle of the item to be updated

curl -X PUT -H "Content-Type: application/json" -d '{"titulo": "Novo Título"}' http://localhost:{$PORT}/tarefas/{id}

DELETE task

  • DELETE /tarefas/{ID}
Parameter Type Description
id number Required. Id of item to delete
curl -X DELETE http://localhost:{$PORT}/tarefas/{id}

Run Locally

Clone the project

  git clone https://github.com/MIKEMARQUEZINI/API_ToDo.git

Go to the project directory

  cd API_ToDo

Install dependencies

  npm install

Start the server

   npx tsc && node dist/app.js