Split site to separate files

This commit is contained in:
nxshock 2021-09-25 12:38:27 +05:00
parent a0e0b7b1cc
commit b0f9ea1f49
7 changed files with 108 additions and 10 deletions

View file

@ -7,7 +7,7 @@ import (
func handleGenres(w http.ResponseWriter, r *http.Request) {
if r.RequestURI != "/" {
http.Error(w, "not found", http.StatusNotFound)
http.FileServer(http.FS(stripSiteFS)).ServeHTTP(w, r)
return
}
@ -18,7 +18,7 @@ func handleGenres(w http.ResponseWriter, r *http.Request) {
Domain: r.Host,
Genres: Genres}
err := templates.Lookup("genres.html").Execute(w, data)
err := templates.Lookup("index.htm").Execute(w, data)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}