Summary
This pretty big chapter served as our first look at interacting with user-provided data and handling web requests. We’ve seen how we can add RESTful endpoints using the Go standard library and have learned how we can use the utility functions of Gorilla Mux to quickly add more power and functionality to our application. We’ve also explored the different ways we can handle requests. In one method, we can now utilize Go’s html/template
library to dynamically create content and package it as a directory read from disk. Alternatively, we can use the new Go e
mbed
directive to give us a single binary that packages up all our assets and makes for simple deployments.
In the next chapter, we will look at adding middleware to help process the request pipeline and introduce security to ensure that content can be accessed securely.