Welcome
Zinc is a Go API framework for developers who want expressive routing and practical helpers without leaving net/http.
It gives you route groups, middleware chains, request binding, response helpers, static files, rendering, route metadata, and first-party middleware while keeping normal Go deployment and testing habits.
go get github.com/0mjs/zinc
package main
import "github.com/0mjs/zinc"
func main() {
app := zinc.New()
app.Get("/", "Hello, World!")
app.Listen()
}
Start buildingInstall Zinc, run a tiny server, and add your first JSON endpoint.Learn the guideWork through routing, middleware, context, binding, responses, and errors.Pick middlewareAdd CORS, auth, logging, recovery, metrics, rate limiting, static files, and more.
What Zinc is good at
- API ergonomics: handlers and middleware use one
func(*zinc.Context) errorshape. - Standard library compatibility: mount
http.Handlervalues and keep normalnet/httpserver behavior. - Fast request paths: Zinc is built around a compact router and a pooled request context.
- Practical defaults: common response formats, request binding, error handling, static files, and middleware are first-party.
Mental model
A Zinc app is a request pipeline:
- app-level middleware runs
- prefix and group middleware run when their route matches
- the route handler writes a response or returns an error
- Zinc's error handler turns returned errors into responses
app.Post("/posts", requireUser, requireRole("editor"), createPost)
Each item in that chain can call c.Next() to continue, return a response to stop, or return an error for the app error handler.
Where to go next
- Installation covers module setup and Go version requirements.
- Quick Start builds a small API in one file.
- First Route explains params, query values, JSON, and errors in one handler.
- Routing is the first full guide page once you are ready for groups and named routes.
- API Reference keeps the method-level details separate from the learning path.