A simple, lightweight REST API for managing notes — built with Node.js and Express.
Notes API — Simple REST API with Node.js + Express
Notes API is a minimal backend REST API that lets you create, read, update, and delete notes via HTTP requests. Built with Node.js and Express, it focuses on clean route structure and straightforward CRUD operations — making it a solid foundation for any note-taking application or a great project for learning backend API development.
No database required to get started — notes are managed in memory, keeping setup fast and friction-free.
- 📥 Add Notes —
POST /notesto create a new note. - 📋 List All Notes —
GET /notesto retrieve the full notes list. - 🗑️ Delete a Note —
DELETE /notes/:indexto remove a note by its index. - ✏️ Update a Note —
PATCH /notes/:indexto update a note's description.
| Category | Technology |
|---|---|
| Runtime | Node.js v18+ |
| Framework | Express 4.x |
| Language | JavaScript (ES6+) |
| Package Mgr | npm |
Verify your versions:
node -v
npm -v-
Clone the repository
git clone https://github.com/neelpatel6262/notes-api.git cd notes-api -
Install dependencies
npm install
-
Start the server
node app.js
The server will start on http://localhost:3000 (or the configured port).
Use any HTTP client (Postman, Insomnia, curl, or a frontend) to interact with the API.
| Method | Endpoint | Description |
|---|---|---|
POST |
/notes |
Add a new note |
GET |
/notes |
Retrieve all notes |
PATCH |
/notes/:index |
Update a note's description |
DELETE |
/notes/:index |
Delete a note by index |
Add a note
curl -X POST http://localhost:3000/notes \
-H "Content-Type: application/json" \
-d '{"title": "My Note", "description": "Note content here"}'Get all notes
curl http://localhost:3000/notesUpdate a note
curl -X PATCH http://localhost:3000/notes/0 \
-H "Content-Type: application/json" \
-d '{"description": "Updated content"}'Delete a note
curl -X DELETE http://localhost:3000/notes/0This is a backend API — no keyboard shortcuts apply. Use a REST client like Postman or Insomnia for a GUI-based testing experience.
notes-api/
├── app.js # Express app entry point — server setup & routes
├── package.json # Dependencies and scripts
└── README.md # Project documentation
- Planned the API surface — identified the four core CRUD operations needed for a notes resource.
- Set up Express — initialized the project, installed dependencies, configured the server.
- Defined routes — implemented
POST,GET,PATCH, andDELETEendpoints with appropriate HTTP methods and status codes. - In-memory storage — used a simple array to store notes, keeping setup fast with no database dependency.
- Tested with curl / Postman — validated all endpoints manually before finalizing.
- Structuring a REST API with Express — routes, middleware, and request/response handling.
- Using correct HTTP methods (
POST,GET,PATCH,DELETE) for CRUD operations. - Parsing JSON request bodies with
express.json()middleware. - Handling index-based resource addressing in URL params (
:index). - Returning appropriate HTTP status codes (
200,201,404,400). - Organizing a minimal Node.js project cleanly from scratch.
| Aspect | Before | After |
|---|---|---|
| Backend knowledge | Frontend only | Comfortable building REST APIs |
| Express routing | Unfamiliar | Confident with routes and middleware |
| HTTP methods | Basic GET/POST understanding | Full CRUD with correct status codes |
| API testing | Manual browser testing | Structured testing via curl / Postman |
- 🗄️ Database integration — persist notes with MongoDB or SQLite.
- 🔐 Authentication — JWT-based auth to protect routes.
- 🆔 UUID-based IDs — replace index-based addressing with stable unique IDs.
- ✅ Input validation — validate request bodies with
express-validatororzod. - 📄 Pagination — limit and paginate results on
GET /notes. - 🌐 Deploy — host on Railway, Render, or Vercel serverless functions.
- 🧪 Tests — add unit/integration tests with Jest or Vitest.
- Notes are stored in memory — all data is lost when the server restarts.
- Index-based addressing can be fragile after deletions (indices shift).
- No input validation — malformed request bodies are not rejected.
- No authentication — all endpoints are publicly accessible.
Contributions and improvements are welcome!
-
Fork the repository.
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Commit your changes and push:
git commit -m "Add: your feature description" git push origin feature/your-feature-name -
Open a Pull Request describing what you changed.
This project is open source under the MIT License — free to use, modify, and distribute.
- Name: Neel Patel
- Email: patelneel392003@gmail.com
- GitHub: github.com/neelpatel6262
- Node.js — JavaScript runtime powering the server.
- Express — Minimal, flexible web framework for Node.js.
- Postman — API testing and development tool.
| Field | Info |
|---|---|
| Project Status | Active / Portfolio-ready |
| Version | 1.0.0 |
| Runtime | Node.js v18+ |
- Express server setup
-
POST /notes— add a note -
GET /notes— list all notes -
PATCH /notes/:index— update note description -
DELETE /notes/:index— delete a note - JSON request body parsing
- Database persistence (MongoDB / SQLite)
- UUID-based IDs
- Input validation
- Authentication (JWT)
- Unit / integration tests
- Deployed to a hosting platform