/todo-list-api

API for managing your to-do tasks

Primary LanguageJavaScript

Todo List API

Welcome to the Todo List API project! This is an API for managing your to-do tasks.

Installation

  1. Make sure you have Node.js and npm installed on your computer.

  2. Clone this repository to your computer:

git clone https://github.com/LordLovelysmell/todo-list-api.git
  1. Install the dependencies:
npm install

Configuration

  1. Create a config.env file in the root folder of the project.

  2. In the config.env file, specify the required environment variables. Example is in example.env and you can freely copy it to config.env.

Running

Running using Docker

To using this option you need Docker to be installed on your computer.

  1. Start the application in development mode using following command:
docker-compose up -d --build

Running without Docker

To using this option you need MongoDB installed on your computer, otherwise the app will not work.

  1. Start the application using following command:
npm start

Interacting with Todo List API using Postman

There is a Postman Collection v2.1 for Postman.

Just import file named api.postman_collection.json located in root directory of the project to Postman (File -> Import).

You will also need to import environment for Postman to effectively interact with Todo List API. The environment is also in the project root.

The Postman collection completely mirroring all wokrkable endpoints.

Todo List API Images

Images loaded using /api/v1/todos/64f18bf743e197ab2f780cd8/attachments endpoint are served at /img/todos/IMAGE_FILENAME.

IMAGE_FILENAME is returned by endpoint above as filename property if loading was successful.

Testing

  1. Run tests:
npm test
  1. Run tests with coverage report:
npm run test:coverage

License

MIT