mirror of
https://github.com/Damillora/phoebe.git
synced 2025-03-10 05:57:22 +00:00
feat: fully complete SPA embedding
This commit is contained in:
parent
69abeb93cb
commit
fa81548e8a
@ -34,11 +34,12 @@ func Start() {
|
||||
webFS := web.WebAssets()
|
||||
webAssets, _ := fs.Sub(webFS, "_app")
|
||||
|
||||
g.StaticFileFS("/", "./app.html", http.FS(webFS))
|
||||
// g.StaticFile("/", "./pkg/web/build/index.html")
|
||||
g.NoRoute(func(c *gin.Context) {
|
||||
//c.String(http.StatusOK, "AAA")
|
||||
c.FileFromFS("./app.html", http.FS(webFS))
|
||||
})
|
||||
g.StaticFS("/_app", http.FS(webAssets))
|
||||
g.Static("/data", config.CurrentConfig.DataDirectory)
|
||||
|
||||
g.Use(cors.Default())
|
||||
|
||||
InitializeRoutes(g)
|
||||
|
@ -1,13 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func InitializeFrontendRoutes(g *gin.Engine) {
|
||||
g.NoRoute(frontendHome)
|
||||
}
|
||||
|
||||
func frontendHome(c *gin.Context) {
|
||||
c.File("./web/static/index.html")
|
||||
}
|
@ -11,6 +11,4 @@ func InitializeRoutes(g *gin.Engine) {
|
||||
InitializeTagRoutes(g)
|
||||
InitializeBlobRoutes(g)
|
||||
InitializePostRoutes(g)
|
||||
|
||||
InitializeFrontendRoutes(g)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user