This repository contains a Todo API built with Node.js and Mongoose, providing endpoints to manage a list of todos.
- Create: Add a new todo
- Read: Retrieve todos or specific todo by ID
- Update: Update a todo by ID
- Delete: Remove a todo by ID
Before running this project locally, ensure you have the following installed:
- Node.js
- MongoDB
-
Clone the repository:
git clone https://github.com/Remonhasan/nodejs-todo-app.git
cd nodejs-todo-app
npm install
Create a .env
file in the root directory and add the following:
PORT=3000
MONGO_URI=your-mongodb-connection-string
npm start
router.get('/', getTodo) // Get all todos
router.post('/save', saveTodo) // Create a new todo
router.post('/update', updateTodo) // Update a todo by ID
router.post('/delete', deleteTodo) // Delete a todo by ID
Made with love for Javascript !