autoinstallers/test.go
2022-05-31 18:28:17 -05:00

30 lines
309 B
Go

// webserver that says hello
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, world!")
}
// Output:
// $ go run test.go
// Hello, world!
// $