Lesson 18 of 60
GoStandard Library: `net/http` – Building a Simple Web Server
25 minutes
Course progress30%
net/http Basics
This lesson explains the main concept clearly with beginner-friendly examples and background so you can learn why the code works.
Go’s standard library ships a fully‑featured HTTP server.
package main
import (
"fmt"
"log"
"net/http"
)
{
fmt.Fprintln(w, )
}
{
http.HandleFunc(, helloHandler)
log.Println()
log.Fatal(http.ListenAndServe(, )
}