Chapter 2.
Getting Started
In this first section of the book, we’re going to set up a project directory and lay the groundwork for building our Greenlight API. We will:
Create a skeleton directory structure for the project and explain at a high-level how our Go code and other assets will be organized.
Establish a HTTP server to listen for incoming HTTP requests.
Introduce a sensible pattern for managing configuration settings (via command-line flags) and using dependency injection to make dependencies available to our handlers.
Use the
httprouter
package to help implement a standard RESTful structure for the API endpoints.