This is a simple API built using Go and the Chi router. It follows a structured project layout for maintainability and scalability.
.
├── api # API-related logic
├── internal # Internal packages
│ ├── tools # Utility functions and helpers
│ ├── handlers # Request handlers for different endpoints
│ ├── middleware # Middleware functions (e.g., authentication)
├── cmd # Entry point of the application
│ ├── api # Main API command
├── go.mod # Go module file
├── go.sum # Dependency checksum file
- Chi Router for handling routes efficiently.
- Middleware for authentication and request processing.
- Modular Structure for better code organization.
- Error Handling with structured responses.
-
Clone the repository:
git clone https://github.com/TheAmgadX/APIs-With-GoLang.git cd APIs-With-GoLang
-
Install dependencies:
go mod tidy
-
Run the application:
go run cmd/api/main.go
Method | Endpoint | Description |
---|---|---|
GET | /account/coins |
Retrieves coin balance |
The project includes middleware for request validation and authentication.