Skip to content

Commit

Permalink
fix: absolute Paths conf.WebDir
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuchange committed Dec 15, 2020
1 parent 0f3523b commit 5fb01a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (
EnvDEV = "dev"
EnvLOCAL = "local"

WebDir = "./html"
WebDir = "/html"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions api/internal/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ func SetUpRouter() *gin.Engine {
store := cookie.NewStore([]byte("secret"))
r.Use(sessions.Sessions("session", store))
r.Use(filter.CORS(), filter.RequestId(), filter.RequestLogHandler(logger), filter.SchemaCheck(), filter.Authentication(), filter.RecoverHandler())
r.Use(static.Serve("/", static.LocalFile(conf.WebDir, false)))
r.Use(static.Serve("/", static.LocalFile(conf.WorkDir + conf.WebDir, false)))
r.NoRoute(func(c *gin.Context) {
c.File(fmt.Sprintf("%s/index.html", conf.WebDir))
c.File(fmt.Sprintf("%s/index.html", conf.WorkDir + conf.WebDir))
})

factories := []handler.RegisterFactory{
Expand Down

0 comments on commit 5fb01a0

Please sign in to comment.