fix static files serving Path.
This commit is contained in:
parent
e4d82673da
commit
52e586790e
1 changed files with 3 additions and 3 deletions
|
|
@ -52,10 +52,10 @@ func New(WebSocketManager types.WebSocketManager, ApiManager types.ApiManager, c
|
|||
if conf.Static != "" {
|
||||
fs := http.FileServer(http.Dir(conf.Static))
|
||||
router.Get("/*", func(w http.ResponseWriter, r *http.Request) {
|
||||
if _, err := os.Stat(conf.Static + r.RequestURI); os.IsNotExist(err) {
|
||||
http.StripPrefix(r.RequestURI, fs).ServeHTTP(w, r)
|
||||
} else {
|
||||
if _, err := os.Stat(conf.Static + r.URL.Path); !os.IsNotExist(err) {
|
||||
fs.ServeHTTP(w, r)
|
||||
} else {
|
||||
utils.HttpNotFound(w)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue