A simple Student Dummy API built using JSON Server, designed for learning and practicing API testing. This API supports CRUD operations (Create, Read, Update, Delete) on student data and is beginner-friendly for practice.
- Retrieve all student records
- Retrieve a student record by ID
- Add new student records
- Update existing student records
- Delete student records
student-dummy-api/
├── students.json # Mock database containing student data
├── README.md # Project documentation
- Node.js (JavaScript runtime)
- npm (Node Package Manager, comes with Node.js)
- JSON Server (Install via npm)
- Open your terminal or command prompt.
- Run the following command to clone this repository:
git clone https://github.com/Kavyakb58/student-dummy-api.git- Navigate to the project directory:
cd student-dummy-apinpm install -g json-servernode -v
npm -vStart the JSON Server by running:
json-server --watch students.jsonBy default, the API will be running at:
http://localhost:3000/students
| Method | Endpoint | Description |
|---|---|---|
| GET | /students |
Get all students |
| GET | /students/:id |
Get a student by ID |
| POST | /students |
Add a new student |
| PUT | /students/:id |
Update entire student record |
| PATCH | /students/:id |
Partially update student record |
| DELETE | /students/:id |
Delete a student record |
POST /students
{
"name": "Alice",
"location": "UK",
"phone": "9876543210",
"courses": ["JavaScript", "Node.js"]
}PUT /students/1
{
"name": "John Updated",
"location": "India",
"phone": "1234567890",
"courses": ["Java", "Selenium"]
}PATCH /students/1
{
"phone": "1112223334"
}DELETE /students/1- Open Postman application.
- Set the request method (GET, POST, PUT, PATCH, DELETE).
- Enter the API URL, for example:
http://localhost:3000/students
- For POST, PUT, PATCH requests, go to the Body tab, select raw, and choose JSON format. Enter JSON data like shown above.
- Click Send to perform the operation and view the response.
This project is licensed under the MIT License.