2023-10-02 02:45:41 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2023-10-02 15:03:04 +02:00
|
|
|
currentConfig := setConfig()
|
|
|
|
listen := currentConfig.host + ":" + currentConfig.port
|
2023-10-02 02:45:41 +02:00
|
|
|
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)
|
2023-10-02 02:45:41 +02:00
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|