Skip to content

nneha19/Task-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗂️ Task Manager API

A simple Task Manager API built using Node.js, Express.js, and Mongodb (with Mongoose).
This project is focused on practising backend fundamentals.


🚀 Tech Stack

  • Node.js
  • Express.js
  • MongoDB Atlas
  • Mongoose

🛠️ Setup Instructions

  1. Clone the repository
    git clone <repository-url>
    cd <project-folder>
    

  1. Install dependencies
    npm install
    

  1. Create a .env file at the root and add your MongoDB URI
    MONGO_URI=your-mongodb-uri
    PORT=3000
    

  1. Run the server
    node index.js 
    
    
  2. Server will run at
    http://localhost:3000/
    

📖 API Endpoints

Method Endpoint Description Body / Query
POST /addtask Add a new task Query params (title, status)
GET /gettask Get all tasks None
GET /gettaskbyid Get task by ID Query param (id)
DELETE /deletetask Delete a task by ID Query param (id)
PATCH /updatetask Update task by ID param (id), Body (fields to update)
GET /filterbystatus Filter tasks by status Query param (status)

✍️ Code Examples

  1. Add a Task
    POST http://localhost:3000/add?title=CompleteAssignment&description=description&status=pending
    
    

  1. Get All Tasks
    GET http://localhost:3000/task
    
    

  1. Get Task By ID
    GET http://localhost:3000/taskid?id=your-task-id
    
    

  1. Delete Task
    DELETE http://localhost:3000/delete?id=your-task-id
    

  1. Update Task
    PATCH http://localhost:3000/update?id=your-task-id
    Body (JSON):
    {
    "status": "completed"
    }
    

  1. Filter Tasks by Status
    GET http://localhost:3000/filterstatus?status=pending
    
    

About

Task management API using Node.js, Express, and Mongoose.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published