Summary
This chapter covered a lot of material on taking an HTTP request and turning it into something usable. At the core of a web framework is its ability to translate a raw request into an actionable handler. We learned about how Sanic does this and how we can use HTTP methods, good API design principles, paths, path parameter extraction, and static content to build useful applications. As we learned earlier in this book, a little bit of upfront planning goes a long way. Before putting too much code together, it is really helpful to think about the tools HTTP offers, and how Sanic allows us to take advantage of those features.
If we did a good job in Chapter 2, Organizing a Project, of setting up directories, it should be very easy for us to loosely mirror that structure and nest blueprints to match our intended API design.
There are some key takeaways from this chapter. You should purposely, and thoughtfully, design your API endpoint paths—using nouns—that point...