mirror of https://github.com/allinssl/allinssl
icon
parent
79ec33b33e
commit
5a30524cce
|
@ -74,8 +74,10 @@ func Register(r *gin.Engine) {
|
||||||
// 1. 提供静态文件服务
|
// 1. 提供静态文件服务
|
||||||
r.StaticFS("/static", http.Dir("./frontend/static")) // 静态资源路径
|
r.StaticFS("/static", http.Dir("./frontend/static")) // 静态资源路径
|
||||||
r.StaticFS("/auto-deploy/static", http.Dir("./frontend/static")) // 静态资源路径
|
r.StaticFS("/auto-deploy/static", http.Dir("./frontend/static")) // 静态资源路径
|
||||||
// icon
|
// 返回 favicon.ico
|
||||||
r.StaticFS("/favicon.ico", http.Dir("./frontend/favicon.ico")) // favicon.ico
|
r.GET("/favicon.ico", func(c *gin.Context) {
|
||||||
|
c.File("./static/favicon.ico")
|
||||||
|
})
|
||||||
|
|
||||||
// 3. 前端路由托管:匹配所有其他路由并返回 index.html
|
// 3. 前端路由托管:匹配所有其他路由并返回 index.html
|
||||||
r.NoRoute(func(c *gin.Context) {
|
r.NoRoute(func(c *gin.Context) {
|
||||||
|
|
Loading…
Reference in New Issue