This repository was archived by the owner on May 24, 2023. It is now read-only.

Description
Hello,
What is the best way to use different handlers, for the same route, depending of ws or non-ws request.
For my project I need to use the same path for regular GET requests and WS requests.
e.g.
app.Use("/ws", func(c *fiber.Ctx) error {
if websocket.IsWebSocketUpgrade(c) {
c.Locals("websocket", true)
}
return c.Next()
})
app.Get("/mypath", standardHandler)
app.Get("/mypath", websocket.New(wsHandler))
With this code, the standardHandler is executed first.
And the only way I found is to test c.Locals("websocket") in standardHandler.
Is there a cleaner way to do it?
Thanks