modulepackage
0.0.0-20241207140232-9d5b3c40b489
Repository: https://github.com/ocrosby/go-reference-api.git
Documentation: pkg.go.dev
# README
Go Reference API
Overview
This API is a simple reference for a minimalistic REST API written in Go. It utilizes the built-in http.ServeMux to handle routing and the built-in http package to handle requests and responses.
Installation
To install the API, clone the repository and run the following command:
go install
Directory Structure
├── cmd/
│ └── app/
│ └── main.go
├── internal/
│ ├── handlers/
│ │ └── handlers.go
│ └── health/
│ └── health.go
├── pkg/
│ ├── adapters/
│ │ └── database.go
│ ├── middleware/
│ │ └── auth.go
│ └── mylibrary/
│ └── mylibrary.go
├── swagger-ui/
│ └── (Swagger UI files)
├── Makefile
├── go.mod
├── go.sum
└── README.md
Routes
The API has the following routes:
/
- Home route/health
- Health check route
Sending a GET request to the /healthz route
curl -X GET http://localhost:8080/healthz
Sned a GET request to the /readyz route
curl -X GET http://localhost:8080/readyz