A simple, clean and fully functional Notes REST API built with Node.js, Express, and MongoDB (Mongoose).
Perfect for learning backend development or integrating into your full-stack projects.
Test all endpoints easily with Postman, Thunder Client, or any API client.
- Create a new note
- Get all notes
- Get a single note by ID
- Update a note (Partial update using PATCH)
- Delete a note
- Search notes by title (case-insensitive)
- Automatic
createdAt&updatedAttimestamps
- Node.js
- Express.js
- MongoDB
- Mongoose
- dotenv
project/
├── controllers/
│ └── noteController.js
├── models/
│ └── noteModel.js
├── routes/
│ └── noteRoutes.js
├── config/
│ └── db.js
├── index.js
├── .env
└── package.json
- Clone the repository
git clone https://github.com/Jerrwin/Node-Notes-API.git cd Node-Notes-API - Install dependencies
npm install
- Create a .env file in the root directory
MONGO_URI=your_mongodb_connection_string_here PORT=5000
- Start the server
Server runs at → http://localhost:5000
npm run dev
| Method | Endpoint | Description |
|---|---|---|
POST |
/notes/add |
Create a new note |
GET |
/notes/getAll |
Get all notes |
GET |
/notes/search?title=xyz |
Search notes by title (case-insensitive) |
PATCH |
/notes/update/:id |
Update a note (partial update) |
DELETE |
/notes/delete/:id |
Delete a note |
Example Request (POST /notes)
{
"title": "My First Note",
"content": "This is important!",
"tags": ["work", "urgent"]
}Feel free to fork this repository and submit pull requests.
This project is beginner-friendly and open for improvements.