Chapter 2.
Foundations
Alright, let’s get started! In this first section of the book we’re going to lay the groundwork for our project and explain the main principles that you need to know for the rest of the application build.
You’ll learn how to:
- Set up a project directory which follows the Go conventions.
- Start a web server and listen for incoming HTTP requests.
- Route requests to different handlers based on the request path and method.
- Use wildcard segments in your routing patterns.
- Send different HTTP responses, headers and status codes to users.
- Structure your project in a sensible and scalable way.
- Render HTML pages and use template inheritance to keep your HTML markup free of duplicate boilerplate code.
- Serve static files like images, CSS and JavaScript from your application.