-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
Description
Using Fiber v1.10.1
Question description
I'm not sure if this is a bug or I understood it wrong.
It seems the root route must be defined first of all routes, otherwise its content will be rendered as plain text.
Code snippet (optional)
This will result in index.html, at /, being rendered as text/plain:
package main
import "github.com/gofiber/fiber"
func main() {
app := fiber.New()
app.Static("/otherPath", otherPath) // I'm using here an absolute path
app.Static("/", "./public")
app.Listen(8000)
}This will result in index.html, at /, being rendered as text/html:
package main
import "github.com/gofiber/fiber"
func main() {
app := fiber.New()
app.Static("/", "./public")
app.Static("/otherPath", otherPath)
app.Listen(8000)
}Of course, this is not a big deal. It's customary to put the root first most of the time, but even so I just don't know, is this intended behavior or...?
Thanks for your time!
Reactions are currently unavailable