Move web assets under webapi package. (#26)
This commit is contained in:
parent
7dbee5b6c2
commit
04311000e8
1
main.go
1
main.go
@ -40,6 +40,7 @@ func run(ctx context.Context) error {
|
||||
|
||||
// Waitgroup for services to signal when they have shutdown cleanly.
|
||||
var shutdownWg sync.WaitGroup
|
||||
defer log.Info("Shutdown complete")
|
||||
|
||||
// Open database.
|
||||
db, err := database.Open(ctx, &shutdownWg, cfg.dbPath)
|
||||
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
@ -87,7 +87,7 @@ func router(releaseMode bool) *gin.Engine {
|
||||
}
|
||||
|
||||
router := gin.New()
|
||||
router.LoadHTMLGlob("templates/*")
|
||||
router.LoadHTMLGlob("webapi/templates/*")
|
||||
|
||||
// Recovery middleware handles any go panics generated while processing web
|
||||
// requests. Ensures a 500 response is sent to the client rather than
|
||||
@ -101,7 +101,7 @@ func router(releaseMode bool) *gin.Engine {
|
||||
}
|
||||
|
||||
// Serve static web resources
|
||||
router.Static("/public", "./public/")
|
||||
router.Static("/public", "webapi/public/")
|
||||
|
||||
router.GET("/", homepage)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user