This is a Todo application built with Express.js and MongoDB. It provides a RESTful API for managing tasks, including creating, reading, updating, and deleting tasks.
- Node.js and npm installed on your machine
- MongoDB running locally or in a Docker container
- Docker (optional, for using Docker Compose)
- Clone the repository:
git clone https://github.com/AbdulrahmanBaiasy/express-todo.git
cd express-todo
- Install the dependencies:
npm install
-
Set up the MongoDB database.
You can either run MongoDB locally or use Docker Compose: Using Docker Compose:
docker-compose up
- Run the application:
npm run start
The application provides the following API endpoints:
-
GET /tasks: Retrieves all tasks.
-
POST /tasks: Creates a new task.
-
PUT /tasks/: Updates an existing task by ID.
-
DELETE /tasks/: Deletes a task by ID.
├─ models/ │ └─ task.js ├─node_modules/ (ignored) ├─ routes/ │ └─ taskRoutes.js ├─ .gitignore ├─ app.js ├─ docker-compose.yml ├─ package-lock.json ├─ package.json └─ readme.md
This script is provided under the MIT License. Feel free to use, modify, and distribute it as needed.