A beginner-friendly REST API built using Node.js and Express.js that performs basic CRUD operations (Create, Read, Update, Delete) on user data.
This project demonstrates how a backend server works:
- Handles HTTP requests (GET, POST, PUT, DELETE)
- Manages user data
- Sends JSON responses
It is a foundation project for learning backend development.
- Node.js
- Express.js
project-folder/
│
├── api.js # Main server file
├── package.json # Project metadata
├── .gitignore # Files to ignore in Git
└── README.md # Project documentation
- ✅ Get all users
- ✅ Get user by ID
- ✅ Create new user
- ✅ Update existing user
- ✅ Delete user
| Method | Endpoint | Description |
|---|---|---|
| GET | /users | Get all users |
| GET | /users/:id | Get user by ID |
| POST | /users | Create new user |
| PUT | /users/:id | Update user |
| DELETE | /users/:id | Delete user |
git clone https://github.com/YOUR_USERNAME/simple-rest-api.git
cd simple-rest-api
npm install
node api.js
👉 Server will run at:
http://localhost:3000
You can use:
- Postman (recommended)
- Browser (for GET requests)
- curl (terminal)
POST /users
{
"name": "Rohit",
"age": 21
}
- Data is stored in memory (array), so it will reset when the server restarts
- This is a beginner-level project (no database yet)
- 🔹 Add MongoDB (Database)
- 🔹 Add Authentication (JWT)
- 🔹 Add Validation
- 🔹 Use MVC architecture
- 🔹 Deploy the API
- How REST APIs work
- Express routing
- Request & Response handling
- CRUD operations
Rohit Singh
Give this repo a ⭐ on GitHub and share it!