

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Welcome to Learn HTTP Servers
incomplete
2: Goroutines in Servers
incomplete
3: Project Setup
incomplete
4: Server
incomplete
5: Fileservers
incomplete
6: Fileserver Quiz
incomplete
7: Serving Images
incomplete
8: Workflow Tips
incomplete
9: Custom Handlers
incomplete
10: Handler Review
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Let's go over some of the code that we used for our simple fileserver and make sure we understand the nuts and bolts.
Consider this code from the main() function and answer the questions:
srv := &http.Server{
Addr: ":" + port,
Handler: mux,
}
log.Printf("Serving files from %s on port: %s\n", filepathRoot, port)
log.Fatal(srv.ListenAndServe())