go(app): use embedded variable value
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
8c7c84f6f9
commit
d99d86a2be
@ -6,7 +6,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) getAssets(live bool) http.FileSystem {
|
func (a *App) getAssets() http.FileSystem {
|
||||||
|
live := a.config.LiveMode
|
||||||
|
|
||||||
if live {
|
if live {
|
||||||
a.logger.Info("assets loaded in live mode")
|
a.logger.Info("assets loaded in live mode")
|
||||||
|
|
||||||
@ -23,7 +25,9 @@ func (a *App) getAssets(live bool) http.FileSystem {
|
|||||||
return http.FS(fsys)
|
return http.FS(fsys)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) getTemplates(live bool) fs.FS {
|
func (a *App) getTemplates() fs.FS {
|
||||||
|
live := a.config.LiveMode
|
||||||
|
|
||||||
if live {
|
if live {
|
||||||
a.logger.Info("templates loaded in live mode")
|
a.logger.Info("templates loaded in live mode")
|
||||||
|
|
||||||
|
@ -11,9 +11,8 @@ import (
|
|||||||
func (a *App) SetupRoutes() {
|
func (a *App) SetupRoutes() {
|
||||||
e := a.E()
|
e := a.E()
|
||||||
conf := a.Config()
|
conf := a.Config()
|
||||||
liveMode := conf.LiveMode
|
assets := http.FileServer(a.getAssets())
|
||||||
assets := http.FileServer(a.getAssets(liveMode))
|
tmpls := a.getTemplates()
|
||||||
tmpls := a.getTemplates(liveMode)
|
|
||||||
|
|
||||||
// run this before declaring any handler funcs.
|
// run this before declaring any handler funcs.
|
||||||
handlers.InitHandlers(a.version, conf, tmpls)
|
handlers.InitHandlers(a.version, conf, tmpls)
|
||||||
|
Loading…
Reference in New Issue
Block a user