Hi everyone.
I just set this
router.StaticFS("/", http.Dir("./frontend/dist"))
router.Static("/download", "./output")
but got error panic: path segment '/download/*filepath' conflicts with existing wildcard '/*filepath' in path '/download/*filepath'
What wrong with me? Many thanks.
Solved by using middleware like
router.Use(static.Serve("/", static.LocalFile("./frontend/dist", true)))
router.Use(static.Serve("/download", static.LocalFile("./output", true)))
Notie import middleware first import "github.com/gin-gonic/contrib/static"
Most helpful comment
Solved by using middleware like
router.Use(static.Serve("/", static.LocalFile("./frontend/dist", true))) router.Use(static.Serve("/download", static.LocalFile("./output", true)))Notie import middleware firstimport "github.com/gin-gonic/contrib/static"