A simple REST API for managing notes using Node.js, Express, and MongoDB.
- Install dependencies:
npm install- Create
.envfile:
MONGODB_URI=your_mongodb_connection_string
PORT=3000- Start the server:
npm start| Method | URL | Description |
|---|---|---|
| GET | /api/notes |
Get all notes |
| POST | /api/notes |
Create a note |
| PUT | /api/notes/:id |
Update a note |
| DELETE | /api/notes/:id |
Delete a note |
POST /api/notes
{
"title": "My Note",
"content": "Note content here"
}GET /api/notes
src/
├── config/ # Database connection
├── controllers/ # Business logic
├── middleware/ # Rate limiting
├── models/ # Data models
├── routes/ # API routes
└── server.js # Main server file
- Node.js
- Express.js
- MongoDB Atlas
- Postman (for testing)