# 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. Read the full lesson: [https://glibcode.net/courses/go-apis/lessons/4](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 ```sh go run ./lessons/04-routing-and-middleware ``` ## Exercises See [exercises.md](exercises.md). Ask in the forum after you have tried.