mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
fix static files serving Path.
This commit is contained in:
parent
e4d82673da
commit
52e586790e
@ -52,10 +52,10 @@ func New(WebSocketManager types.WebSocketManager, ApiManager types.ApiManager, c
|
|||||||
if conf.Static != "" {
|
if conf.Static != "" {
|
||||||
fs := http.FileServer(http.Dir(conf.Static))
|
fs := http.FileServer(http.Dir(conf.Static))
|
||||||
router.Get("/*", func(w http.ResponseWriter, r *http.Request) {
|
router.Get("/*", func(w http.ResponseWriter, r *http.Request) {
|
||||||
if _, err := os.Stat(conf.Static + r.RequestURI); os.IsNotExist(err) {
|
if _, err := os.Stat(conf.Static + r.URL.Path); !os.IsNotExist(err) {
|
||||||
http.StripPrefix(r.RequestURI, fs).ServeHTTP(w, r)
|
|
||||||
} else {
|
|
||||||
fs.ServeHTTP(w, r)
|
fs.ServeHTTP(w, r)
|
||||||
|
} else {
|
||||||
|
utils.HttpNotFound(w)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user