We're building a fully-fledged web server from scratch on your local machine. The test suite will make HTTP requests to your local server over localhost. Your server will run in one terminal, while you submit tests with the Boot.dev CLI in another terminal.
1.22+.bootdev login to authenticate.The lessons in this course require at least version 1.22 of Go. If you're using an older version, you'll run into some frustrating issues!
Create a new GitHub/GitLab repository for your Chirpy project, and clone it down onto your local machine. Use go mod init to create a new Go module for the project, and add a main.go file. That's where you'll be writing your code for each assignment.
Do not delete your work after each assignment! Each lesson will build upon the previous ones so we'll be reusing a lot of code.
The Go standard library makes it easy to build a simple server. Your task is to build and run a server that binds to localhost:8080 and always responds with a 404 Not Found response.
.Addr field to ":8080"Being a programmer means reading documentation and searching for examples. This is an essential skill because a professional in any field should never stop learning. In fact, the best way to learn is on the clock. Check out the docs provided for examples and be sure to read the http package's Overview as a primer.
Run and submit the CLI tests using the Boot.dev CLI tool in another terminal window while your server is still running.
go mod init to create a Go module for your project