Serve static files separately
It was serving all static files returning the same last one.
This commit is contained in:
parent
825bad4540
commit
58ed66d426
1 changed files with 2 additions and 1 deletions
|
@ -150,8 +150,9 @@ func InitRouter(db database.DB, sg *StatsGatherer, assetsPath string) {
|
|||
r.HandleFunc("/", sg.Gather(indexHandler))
|
||||
|
||||
for _, file := range []string{"robots.txt", "description.json", "opensearch.xml", "key.asc"} {
|
||||
path := path.Join(assetsPath, file)
|
||||
serveFunc := func(w http.ResponseWriter, r *http.Request) {
|
||||
http.ServeFile(w, r, path.Join(assetsPath, file))
|
||||
http.ServeFile(w, r, path)
|
||||
}
|
||||
r.HandleFunc("/"+file, serveFunc)
|
||||
}
|
||||
|
|
Reference in a new issue