Skip to content

Commit

Permalink
Only display landing page on /
Browse files Browse the repository at this point in the history
  • Loading branch information
Toon Schoenmakers committed Oct 29, 2024
1 parent ad41e17 commit b92968a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web/landing_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ func NewLandingPage(c LandingConfig) (*LandingPageHandler, error) {
}

func (h *LandingPageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
w.Write([]byte("Not Found"))
w.WriteHeader(http.StatusNotFound)
return
}
w.Header().Add("Content-Type", "text/html; charset=UTF-8")
w.Write(h.landingPage)
}

0 comments on commit b92968a

Please sign in to comment.