autoinstallers/test.go

30 lines
309 B
Go
Raw Normal View History

2022-05-31 19:28:17 -04:00
// 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!
// $