Static serve
This commit is contained in:
@ -19,6 +19,7 @@ type configStruct struct {
|
||||
DisableSendMail bool `yaml:"disableSendMail"`
|
||||
IsProduction bool `yaml:"isProduction"`
|
||||
LoopDelay uint32 `yaml:"loopDelay"`
|
||||
StaticDir string `yaml:"staticDir"`
|
||||
} `yaml:"application"`
|
||||
Database struct {
|
||||
Host string `yaml:"host"`
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -4,23 +4,30 @@
|
||||
|
||||
{{ block mainContent() }}
|
||||
|
||||
<div class="row">
|
||||
<form class="mb-5 col-4 ms-auto me-auto" method="post" action="/">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Email address</label>
|
||||
<input type="email" name="email" class="form-control" value="edkirin@gmail.com">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Password</label>
|
||||
<input type="text" name="password" class="form-control" value="tralala">
|
||||
</div>
|
||||
<div class="row mt-5">
|
||||
<div class="col">
|
||||
<form method="post" action="/">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Email address</label>
|
||||
<input type="email" name="email" class="form-control" value="edkirin@gmail.com">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Password</label>
|
||||
<input type="text" name="password" class="form-control" value="tralala">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-success">
|
||||
Submit
|
||||
</button>
|
||||
</form>
|
||||
<button type="submit" class="btn btn-success">
|
||||
Submit
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="col">
|
||||
<img src="/static/sample.jpg" class="img-fluid" alt="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="lead">
|
||||
<p>Bacon ipsum dolor amet leberkas kevin meatball pork loin beef ribs prosciutto, turducken bacon bresaola tri-tip.
|
||||
Strip steak flank shankle, sirloin short ribs shoulder meatball pork chop kevin ribeye jowl ham pork belly
|
||||
|
||||
Reference in New Issue
Block a user