We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a71ca63 commit 57056fdCopy full SHA for 57056fd
platform/website/server/server.go
@@ -17,12 +17,17 @@ var requestsServed = promauto.NewCounter(prometheus.CounterOpts{
17
})
18
19
func page(w http.ResponseWriter, r *http.Request) {
20
- fmt.Fprintf(w, "Welcome to the homeworld self-hosting website.")
+ if r.URL.Path != "/" {
21
+ http.NotFound(w, r)
22
+ return
23
+ }
24
+ fmt.Fprintln(w, "Welcome to the homeworld self-hosting website.")
25
requestsServed.Inc()
26
}
27
28
func main() {
29
http.HandleFunc("/", page)
30
http.Handle("/metrics", promhttp.Handler())
31
+ log.Println("Listening on :8080")
32
log.Fatal(http.ListenAndServe(":8080", nil))
33
0 commit comments