diff --git a/web/server.go b/web/server.go index 96d5bc8..79a2bb9 100644 --- a/web/server.go +++ b/web/server.go @@ -19,8 +19,7 @@ var htmlTemplates embed.FS func InitMux() *http.ServeMux { mux := http.NewServeMux() - mux.HandleFunc("/games/", gamesIndexPageHandler) - mux.HandleFunc("/movies/", moviePageHandler) + mux.Handle("/", http.FileServer(http.Dir("web/static"))) mux.HandleFunc("/games-index/", gameIndexHandler) mux.HandleFunc("/movies-search/", movieSearchHandler) return mux @@ -31,16 +30,6 @@ type MediaByBranch struct { Media []domain.Media } -func gamesIndexPageHandler(respWriter http.ResponseWriter, request *http.Request) { - templ := template.Must(template.ParseFS(htmlTemplates, "templates/games-index.html")) - templ.Execute(respWriter, nil) -} - -func moviePageHandler(respWriter http.ResponseWriter, request *http.Request) { - template := template.Must(template.ParseFS(htmlTemplates, "templates/movies.html")) - template.Execute(respWriter, nil) -} - func gameSearchHandler(respWriter http.ResponseWriter, request *http.Request) { } diff --git a/web/templates/games-index.html b/web/static/games-index.html similarity index 100% rename from web/templates/games-index.html rename to web/static/games-index.html diff --git a/web/templates/movies.html b/web/static/movies.html similarity index 100% rename from web/templates/movies.html rename to web/static/movies.html