mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-03 08:50:13 +02:00
refactor HTTP error.
This commit is contained in:
parent
d46c5d9d30
commit
4fa11e6a2a
15 changed files with 166 additions and 102 deletions
|
@ -13,7 +13,6 @@ import (
|
|||
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
||||
type HttpManagerCtx struct {
|
||||
|
@ -55,13 +54,13 @@ func New(WebSocketManager types.WebSocketManager, ApiManager types.ApiManager, c
|
|||
if _, err := os.Stat(config.Static + r.URL.Path); !os.IsNotExist(err) {
|
||||
fs.ServeHTTP(w, r)
|
||||
} else {
|
||||
utils.HttpNotFound(w)
|
||||
http.NotFound(w, r)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
router.NotFound(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
utils.HttpNotFound(w)
|
||||
http.NotFound(w, r)
|
||||
}))
|
||||
|
||||
return &HttpManagerCtx{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue