Module 09 Β· PawWalk Kickoff β Lesson 3 of 3 Β· ~11 min
The walkers endpoint
The first real endpoint
Time to serve data. In the iOS app, the walker list screen fetched GET /walkers and got back JSON. Now you build the other end of that call.
The pattern for every endpoint in this service is the same: a handler struct holds its dependencies (here, a repository that knows how to fetch walkers), and each route is a method on that struct. Bundling the dependency into the struct means the handler never reaches for globals β everything it needs is a field.