aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index 11701be..7c2b48a 100644
--- a/main.go
+++ b/main.go
@@ -6,6 +6,7 @@ import (
"flag"
"github.com/anhgelus/golatt"
"log/slog"
+ "net/http"
"os"
)
@@ -58,5 +59,9 @@ func main() {
g.NewTemplate("index", "/", cfg.Person.Name, "", "", &cfg).Handle()
g.NewTemplate("credits", "/credits", "Credits", "", "", &cfg).Handle()
+ g.NotFoundHandler = func(w http.ResponseWriter, r *http.Request) {
+ http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
+ }
+
g.StartServer(":80")
}