plakken/main.go

23 lines
386 B
Go
Raw Normal View History

package main
import (
"fmt"
"net/http"
)
func main() {
2023-10-02 15:03:04 +02:00
currentConfig := setConfig()
listen := currentConfig.host + ":" + currentConfig.port
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
_, err := fmt.Fprintf(w, "Hello, you're at %s", r.URL.Path)
if err != nil {
return
}
})
2023-10-02 15:03:04 +02:00
err := http.ListenAndServe(listen, nil)
if err != nil {
return
}
}