An open API service indexing awesome lists of open source software.

https://github.com/matt-riley/go-api-template

Minimal Go API template with Chi, Docker, CI, and GHCR publishing.
https://github.com/matt-riley/go-api-template

chi docker go rest-api template

Last synced: about 9 hours ago
JSON representation

Minimal Go API template with Chi, Docker, CI, and GHCR publishing.

Awesome Lists containing this project

README

          

# go-api-template

A minimal Go API template using [Chi](https://github.com/go-chi/chi).

## Features

- Chi router with structured logging and panic recovery
- Health check at `/health`
- Graceful shutdown
- Multi-stage Docker build (distroless)
- CI via shared workflows: test, lint (golangci-lint), security (govulncheck)
- Docker image published to GHCR on tags

## Getting started

```bash
# Run locally
make dev

# Run tests
make test

# Build
make build

# Build Docker image
docker build -t go-api-template .
```

## Endpoints

| Method | Path | Description |
| ------ | ---------- | -------------------- |
| GET | `/health` | Health check |
| GET | `/api/v1/` | Hello World endpoint |

## Configuration

| Variable | Default | Description |
| -------- | ------- | ----------- |
| `PORT` | `8080` | Server port |