summaryrefslogtreecommitdiff
path: root/internal/server/router.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/server/router.go')
-rw-r--r--internal/server/router.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/server/router.go b/internal/server/router.go
index ed33c19..9b03371 100644
--- a/internal/server/router.go
+++ b/internal/server/router.go
@@ -16,7 +16,12 @@ func (srv *server) ListenToRequests() {
WriteTimeout: time.Second * 5,
}
- mux.HandleFunc("/ping", h.Ping)
+ fs := http.FileServer(http.Dir("assets/"))
+ mux.Handle("GET /assets/", http.StripPrefix("/assets/", fs))
+
+ mux.HandleFunc("GET /ping", h.Ping)
+ mux.HandleFunc("GET /", h.MainPage)
+ mux.HandleFunc("POST /", h.HandleForm)
fmt.Printf("Listening on %v\n", server.Addr)
server.ListenAndServe()