π Students API
This project is a RESTful API built with Go that manages student records. It allows users to perform CRUD (Create, Read, Update, Delete) operations on student data. The API is designed to be simple, efficient, and easy to use.
β¨ Features
- Create new student records
- Retrieve individual student records
- Retrieve list of all student records
π Technologies Used
π‘ API Endpoints
| Method |
Endpoint |
Description |
| POST |
/api/students |
Create a new student |
| GET |
/api/students/{id} |
Retrieve a student by ID |
| GET |
/api/students |
Retrieve list of all students |
π§ͺ Example Usage
β Create Student
Request:
POST - http://localhost:5050/api/students
Body:
{
"name": "Onkar",
"age": 19,
"email": "onkar@email.com"
}
Response:
{
"id": 1
}
π Get Student by ID
Request:
GET - http://localhost:5050/api/students/1
Response:
{
"id": 1,
"name": "Onkar",
"email": "onkar@email.com",
"age": 19
}
π Get All Students
Request:
GET - http://localhost:5050/api/students
Response:
[
{
"id": 1,
"name": "Onkar",
"email": "onkar@email.com",
"age": 19
},
{
"id": 2,
"name": "Abhi",
"email": "Abhi@email.com",
"age": 59
}
]
π€ Contributing
Contributions are welcome!
Please fork the repository and create a pull request with your changes.
π License
This project is licensed under the MIT License.
π§° Development Setup (Optional)
You can use MSYS2 for setting up a Go development environment on Windows.