Enabling static files

This commit is contained in:
Muyao CHEN
2024-06-28 22:30:19 +02:00
parent c15e4da93c
commit 6e6b003e05
5 changed files with 4 additions and 0 deletions

View File

@ -20,5 +20,8 @@ func routes(app *config.AppConfig) http.Handler {
mux.Get("/", handlers.Repo.Home)
mux.Get("/about", handlers.Repo.About)
fileServer := http.FileServer(http.Dir("./static/"))
mux.Handle("/static/*", http.StripPrefix("/static", fileServer))
return mux
}