Skip to content

Commit

Permalink
add / index.html redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
balazs4 committed Apr 10, 2024
1 parent 8bc6262 commit 7b8e0c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func main() {

http.HandleFunc("GET /.servus", serverSideEvent(logger, watcher))
http.HandleFunc("GET /{file}", serveFile(logger))
http.Handle("GET /", http.RedirectHandler("/index.html", http.StatusSeeOther))

logger.Printf("pid=%d url=http://localhost:%d\n", os.Getpid(), port)
err := http.ListenAndServe(fmt.Sprintf(":%d", port), nil)
Expand Down

0 comments on commit 7b8e0c4

Please sign in to comment.