A simple and modular RESTful API for managing tasks, built with Express.js and MongoDB.
- Create, read, update, and delete tasks (CRUD)
- Pagination support for task listing
- Search tasks by title (case-insensitive)
- Data validation and offensive language filtering
- Modular route and error handler structure
- Environment-based configuration
- Graceful shutdown with MongoDB disconnection
- Node.js
- Express.js
- MongoDB + Mongoose
- dotenv
Clone the repository:
git clone https://github.com/gh-aam/task-management-api-3.gitGo to project directory:
cd task-management-api-3Install dependencies:
npm installCreate a .env file in the root:
MONGODB_URI=mongodb://localhost:27017/your_mongodb_database_name
MONGODB_USER=your_mongodb_user_name
MONGODB_PASS=your_mongodb_password
EXPRESS_PORT=3000
OFFENSIVE_WORDS=offword1,offword2,offword3Start the server:
npm startGET /: Welcome message
POST /tasks: Create a new task
GET /tasks: Get all tasks with pagination
GET /tasks/search: Search tasks by title (case-insensitive)
GET /tasks/:id: Get a specific task by ID
PUT /tasks/:id: Update an existing task by ID
DELETE /tasks/:id: Delete a task by ID
page: Page number (default: 1)
limit: Items per page (default: 10)
title: Search query for task title