Back to all catalogs

go-api-template

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

Last synced:

Template metadata

Repository
matt-riley/go-api-template
Language
Go
Topics
chi, docker, go, rest-api, template
Last updated

README

go-api-template

A minimal Go API template using 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

# 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