Cleanup
This commit is contained in:
parent
eea8458206
commit
738d76fac2
2 changed files with 8 additions and 8 deletions
10
main.go
10
main.go
|
@ -54,17 +54,19 @@ func (g *goDash) startServer() {
|
|||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
g := goDash{router: echo.New()}
|
||||
func (g *goDash) setupTemplateRender() {
|
||||
g.router.Renderer = &TemplateRenderer{
|
||||
templates: template.Must(template.ParseGlob("templates/*.gohtml")),
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
g := goDash{router: echo.New()}
|
||||
if err := env.Parse(&g.config); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
g.router.Debug = true
|
||||
|
||||
g.setupTemplateRender()
|
||||
g.setupLogger()
|
||||
defer func(logger *zap.SugaredLogger) {
|
||||
_ = logger.Sync()
|
||||
|
|
|
@ -5,12 +5,10 @@ func (g *goDash) setupRouter() {
|
|||
g.router.GET("/ws", g.ws)
|
||||
g.router.GET("/robots.txt", robots)
|
||||
|
||||
static := g.router.Group("/static")
|
||||
static.Use(longCacheLifetime)
|
||||
static := g.router.Group("/static", longCacheLifetime)
|
||||
static.Static("/", "static")
|
||||
|
||||
storage := g.router.Group("/storage")
|
||||
storage.Use(longCacheLifetime)
|
||||
storage := g.router.Group("/storage", longCacheLifetime)
|
||||
storage.Static("/icons", "storage/icons")
|
||||
|
||||
g.router.RouteNotFound("/*", redirectHome)
|
||||
|
|
Loading…
Add table
Reference in a new issue