static index.html files are now atuomatic used for the directoryroot.
Dieser Commit ist enthalten in:
Ursprung
ec3f82590d
Commit
07218169a6
|
@ -65,7 +65,11 @@ func StaticFS(r gin.IRouter, files fs.FS) {
|
|||
sub, _ := fs.Sub(files, fn.Name())
|
||||
StaticFS(r.Group("/"+fn.Name()), sub)
|
||||
} else {
|
||||
r.GET("/"+fn.Name(), makeHandler(files, fn.Name()))
|
||||
h := makeHandler(files, fn.Name())
|
||||
if fn.Name() == "index.html" {
|
||||
r.GET("/", h)
|
||||
}
|
||||
r.GET("/"+fn.Name(), h)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Laden…
In neuem Issue referenzieren