Static serve

This commit is contained in:
Eden Kirin
2023-10-26 22:08:14 +02:00
parent 3290837555
commit 442b145711
5 changed files with 28 additions and 14 deletions

View File

@ -91,6 +91,11 @@ func createApp() *iris.Application {
app.UseRouter(accessLog.Handler)
app.RegisterView(iris.Jet("./app/templates", ".jet").Reload(true))
views.CreateRouter(app)
if len(cfg.Config.Application.StaticDir) > 0 {
app.HandleDir("/static", iris.Dir(cfg.Config.Application.StaticDir))
}
return app
}