Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Mount sub fiber app on "/" #1842

lotryas opened this issue Mar 31, 2022 · 4 comments 路 Fixed by #1848

馃悰 Mount sub fiber app on "/" #1842

lotryas opened this issue Mar 31, 2022 · 4 comments 路 Fixed by #1848


Copy link

lotryas commented Mar 31, 2022

Fiber version

Issue description
I can access http://localhost:3000/hello but I can't access http://localhost:3000/ for some reason. I get a 404 response from the last handler

Code snippet

package main

import (


func main() {
    app := fiber.New()

    api := fiber.New()
    api.Get("/", func(c *fiber.Ctx) error { return c.SendString("api") })

    web := fiber.New()
    web.Get("/", func(c *fiber.Ctx) error { return c.SendString("home") })
    web.Get("/hello", func(c *fiber.Ctx) error { return c.SendString("hello") })
    web.Use(func(c *fiber.Ctx) error {
        return fiber.NewError(fiber.StatusNotFound)

    app.Mount("/api", api)
    app.Mount("/", web)

curl -i http://localhost:3000//
curl -i http://localhost:3000/hello
curl -i http://localhost:3000/
Copy link

welcome bot commented Mar 31, 2022

Thanks for opening your first issue here! 馃帀 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord

Copy link

thuri10 commented Mar 31, 2022

The bug issue raised is not a fiber framework issue but a bug on your code. This is because both app and web variable route definitions calls to the same route "/" causing a conflict on the requests, therefore the response failing. For "/hello" route you are getting result because there is no conflict of routes.

Copy link

ReneWerner87 commented Apr 5, 2022


its fixed with the last commit
require v2.31.1-0.20220405064022-a8f9d4acfb2c


Copy link

ReneWerner87 commented Apr 5, 2022

Reason for the bugs:
problem was solved by optimizing the mounting
there the functionality for the root path was broken, because there a trimRight with "/" was used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants