A Go 1.25 REST API starter built only on net/http and log/slog, for developers who want an API with no framework and no third-party modules. It includes / and /health routes, per-request structured logs, graceful shutdown, table-driven httptest tests and a multi-stage Dockerfile.
by Light CloudREST APIs
main.go only wires things together: it loads PORT from internal/config, builds the handler from internal/server and runs an http.Server until a stop signal arrives. Routing uses the standard ServeMux, so adding a route with a method and path wildcard, such as GET /items/{id} read with r.PathValue, needs no router package. The trade-off is that you write your own JSON helpers and validation, which is the point of a zero-dependency start. On Light Cloud the image is built from the Dockerfile and run as a container on the platform's PORT, and every push to your copy rebuilds it.
Since Go 1.22 the standard ServeMux matches methods and wildcards. Register mux.HandleFunc("GET /items/{id}", h.getItem) in internal/server/server.go and read the value with r.PathValue("id").
Not for a JSON API of this size: net/http handles routing and middleware is a function wrapping an http.Handler. Reach for a framework when you want its request binding, validation or middleware collection.
Add a field to Config in internal/config/config.go and read it in Load with getenv("NAME", "default"). Put a local value in .env, which make run loads.
Yes. There is no Light Cloud code in it: docker build and docker run the Dockerfile on any container platform, or copy the binary from make build to a server and start it with PORT set.
This one has no database. The gin-postgresql-crud-api template shows a Go app on PostgreSQL with pgx, reading the DB_HOST, DB_NAME, DB_USER and DB_PASSWORD variables Light Cloud sets.
Start a Go API with Gin routing, slog request logs, panic recovery and route tests
Start a Go CRUD API on PostgreSQL with Gin, pgx, input validation and route tests
Start a Go API on Echo with request logs, error handling and graceful shutdown in place