Gin: Static file not work

Created on 11 Apr 2017  路  1Comment  路  Source: gin-gonic/gin

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.

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 first import "github.com/gin-gonic/contrib/static"

>All comments

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"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olegsobchuk picture olegsobchuk  路  3Comments

ccaza picture ccaza  路  3Comments

kekemuyu picture kekemuyu  路  3Comments

CodingPapi picture CodingPapi  路  3Comments

Bloomca picture Bloomca  路  3Comments