try fix path problem

This commit is contained in:
Help-14 2022-04-16 09:05:06 +07:00
parent 34482f8485
commit 3d301a4f15

View file

@ -30,14 +30,13 @@ func main() {
websiteData.Language = modules.LoadLanguage(appConfig.Website.Language)
websiteData.Contents = modules.LoadContent().Data
commonfs := http.FileServer(http.Dir("./common"))
commonfs := http.FileServer(http.Dir(filepath.Join(pwd, "common")))
http.Handle("/common/", http.StripPrefix("/common/", commonfs))
languagefs := http.FileServer(http.Dir("./languages"))
languagefs := http.FileServer(http.Dir(filepath.Join(pwd, "languages")))
http.Handle("/languages/", http.StripPrefix("/languages/", languagefs))
themePath := "/themes/" + appConfig.Website.Theme + "/"
themefs := http.FileServer(http.Dir("." + themePath))
themefs := http.FileServer(http.Dir(filepath.Join(pwd, "themes", appConfig.Website.Theme)))
http.Handle("/theme/", http.StripPrefix("/theme/", themefs))
http.HandleFunc("/weather", serveWeather)