gin icon indicating copy to clipboard operation
gin copied to clipboard

static How to show only files,not dir.

Open birdycn opened this issue 4 years ago • 1 comments

router.Static("/public", "upload")

I want users to be able to access files only when they exist

example:

/public/aaa/1.png

not show the dir when: /public/aaa

birdycn avatar Feb 23 '21 15:02 birdycn

Hi Guy ,You Can Try this

router.StaticFS("/", gin.Dir("public", false))

JoiLa avatar Jun 17 '22 09:06 JoiLa