students-api

module
v0.0.0-...-acee299 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2025 License: MIT

README ΒΆ

πŸŽ“ 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.

Directories ΒΆ

Path Synopsis
cmd
students-api command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL