fix: support new static file
This commit is contained in:
parent
bd84c433cd
commit
86b2dcd248
|
@ -99,21 +99,7 @@ func configNoRoute(r *gin.Engine) {
|
||||||
arr := strings.Split(c.Request.URL.Path, ".")
|
arr := strings.Split(c.Request.URL.Path, ".")
|
||||||
suffix := arr[len(arr)-1]
|
suffix := arr[len(arr)-1]
|
||||||
switch suffix {
|
switch suffix {
|
||||||
case "png":
|
case "png", "jpeg", "jpg", "svg", "ico", "gif", "css", "js", "html", "htm", "gz", "map":
|
||||||
fallthrough
|
|
||||||
case "jpeg":
|
|
||||||
fallthrough
|
|
||||||
case "jpg":
|
|
||||||
fallthrough
|
|
||||||
case "gif":
|
|
||||||
fallthrough
|
|
||||||
case "css":
|
|
||||||
fallthrough
|
|
||||||
case "js":
|
|
||||||
fallthrough
|
|
||||||
case "html":
|
|
||||||
fallthrough
|
|
||||||
case "htm":
|
|
||||||
c.File(path.Join(strings.Split("pub/"+c.Request.URL.Path, "/")...))
|
c.File(path.Join(strings.Split("pub/"+c.Request.URL.Path, "/")...))
|
||||||
default:
|
default:
|
||||||
c.File(path.Join("pub", "index.html"))
|
c.File(path.Join("pub", "index.html"))
|
||||||
|
|
Loading…
Reference in New Issue