Skip to content

safaa-alnabulsi/todo-api

Repository files navigation

Todo API

A simple example of a RESTful API that handles TODO list of items. It's built using TypeScript, expressjs and mongoosejs.

Prerequisites

  • Yarn installed on your machine.
  • MongoDB account so you can create a mongodb cluster clustertodo and a user.
  • PostMan or Insomnia or simply curl to invoke the API endpoints.

Installation

  1. Clone the repository: git clone git@github.com:safaa-alnabulsi/todo-api.git
  2. Install the application: yarn install
  3. Place your own MongoDB User credentials in nodemon.json
{
  "env": {
    "MONGO_USER": "<Username>",
    "MONGO_PASSWORD": "<password>",
    "MONGO_DB": "clustertodo"
  }
}
  1. Build the project and start the server: yarn build && yarn start
  2. Open Insmonia and make a GET request to http://localhost:4000/todos/. It will like the image below after you add your endpoints and couple of todos:

Insomina app

Endpoints

Method End-Point Description
GET /todos List all todos
POST /todos Create a new todo
GET /todos/:id Fetch a specific todo
PUT /todos/:id Edit existing todo
PATCH /todos/:id Mark an existing todo as complete
DELETE /todos/:id Delete existing todo

TODO next

To add the following:

  • Authentication
  • Etags
  • JSON Schema

References

About

A simple example of a RESTful API that handles TODO list of items. It's built using TypeScript, expressjs and mongoosejs.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •