A simple, lightweight RESTful API for managing tasks, built using Node.js, Express.js, and MongoDB.
- Create new tasks
- Read all tasks or fetch a specific task by its ID
- Update existing task details or completion status
- Delete tasks no longer needed
- Runtime Environment: Node.js
- Web Framework: Express.js
- Database: MongoDB (via Mongoose)
-
Clone the repository
git clone [https://github.com/unclepro/task-manager-express.git](https://github.com/unclepro/task-manager-express.git) cd task-manager-express -
Install dependencies
npm install
-
Set up Environment Variables Create a
.envfile in the root directory of the project and add your MongoDB connection string:MONGO_URI=your_mongodb_connection_string_here PORT=3000
-
Start the development server
npm start
The server should now be running on
http://localhost:3000.
| HTTP Method | Endpoint | Action |
|---|---|---|
GET |
/api/v1/tasks |
Get all tasks |
GET |
/api/v1/tasks/:id |
Get a single task by ID |
POST |
/api/v1/tasks |
Create a new task |
PATCH |
/api/v1/tasks/:id |
Update an existing task |
DELETE |
/api/v1/tasks/:id |
Delete a task |