mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add path prefix to server.
This commit is contained in:
@ -36,6 +36,12 @@ func New(WebSocketManager types.WebSocketManager, ApiManager types.ApiManager, c
|
||||
MaxAge: 300, // Maximum value not ignored by any of major browsers
|
||||
}))
|
||||
|
||||
if config.PathPrefix != "/" {
|
||||
router.UseBypass(func(h http.Handler) http.Handler {
|
||||
return http.StripPrefix(config.PathPrefix, h)
|
||||
})
|
||||
}
|
||||
|
||||
router.Route("/api", ApiManager.Route)
|
||||
|
||||
router.Get("/api/ws", WebSocketManager.Upgrade(func(r *http.Request) bool {
|
||||
|
Reference in New Issue
Block a user