up
This commit is contained in:
@@ -2,6 +2,7 @@ package router
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"lmvpn/internal/handler"
|
"lmvpn/internal/handler"
|
||||||
@@ -43,6 +44,10 @@ func Setup(r *gin.Engine) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path := "./dist" + c.Request.URL.Path
|
||||||
|
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||||
|
c.Request.URL.Path = "/"
|
||||||
|
}
|
||||||
fs.ServeHTTP(c.Writer, c.Request)
|
fs.ServeHTTP(c.Writer, c.Request)
|
||||||
c.Abort()
|
c.Abort()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user