21 lines569 B

Lesson 4: Routing and middleware

We look at routing and middleware the way working developers use it, with examples you can change and run right away.

Full lesson: https://glibcode.net/courses/go-apis/lessons/4

Files

  • main.go: method patterns and a logging middleware

Tip: Run gofmt -w . before committing; nobody argues about formatting in Go.

Run it

go run ./lessons/04-routing-and-middleware

Exercises

See exercises.md. Ask in the forum after you have tried.