Building APIs in Go The Stack Without a Framework
summary
Builds a small versioned REST CRUD API for a nutrition service (fruits, grains, vegetables) using plain net/http handler funcs and a gorilla/mux router, Postgres accessed via database/sql + lib/pq, migrations run with golang-migrate, simple token check using net/http BasicAuth, and a time‑based rate limiter. Code on GitHub shows controller functions that json.Marshal model results, SQL queries executed with Exec/Query/QueryRow, and migrations as sequential .up/.down SQL files — a working DIY stack.
AI-written summary · about
chapters (10)
- 0:00Start
- 3:39The Problem Set: Nutritional API
- 7:10How do I DIY?
- 8:52Type Serve Mux
- 10:54go/chi
- 17:07Router
- 17:55Controller
- 19:59Ratelimiting
- 20:13Summary
- 20:37References








