Feature: logger and prefork
This commit is contained in:
parent
6c42f6b6b9
commit
d1bbc9b150
3 changed files with 11 additions and 7 deletions
6
main.go
6
main.go
|
@ -6,6 +6,7 @@ import (
|
||||||
"pixivfe/views"
|
"pixivfe/views"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/gofiber/fiber/v2/middleware/logger"
|
||||||
"github.com/gofiber/template/html/v2"
|
"github.com/gofiber/template/html/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -16,9 +17,12 @@ func setupRouter() *fiber.App {
|
||||||
handler.GetTemplateFunctions(engine)
|
handler.GetTemplateFunctions(engine)
|
||||||
|
|
||||||
server := fiber.New(fiber.Config{
|
server := fiber.New(fiber.Config{
|
||||||
Views: engine,
|
Views: engine,
|
||||||
|
Prefork: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
server.Use(logger.New())
|
||||||
|
|
||||||
// Static files
|
// Static files
|
||||||
server.Static("/favicon.ico", "./template/favicon.ico")
|
server.Static("/favicon.ico", "./template/favicon.ico")
|
||||||
server.Static("css/", "./template/css")
|
server.Static("css/", "./template/css")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{ template "header.html" .Title }} {{ $parent := . }}
|
{{ template "header" .Title }} {{ $parent := . }}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="artwork-page">
|
<div class="artwork-page">
|
||||||
{{ with .Illust }}
|
{{ with .Illust }}
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<div class="thumbnail-container">
|
<div class="thumbnail-container">
|
||||||
{{ range $parent.Artist.Artworks }}
|
{{ range $parent.Artist.Artworks }}
|
||||||
<div class="artwork-thumbnail-small artwork-thumbnail">
|
<div class="artwork-thumbnail-small artwork-thumbnail">
|
||||||
{{ template "thumbnail-dt.html" . }}
|
{{ template "thumbnail-dt" . }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<h2>Related works</h2>
|
<h2>Related works</h2>
|
||||||
<div>{{ template "small-tn.html" .Related }}</div>
|
<div>{{ template "small-tn" .Related }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ template "footer.html" }}
|
{{ template "footer" }}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{{ range . }} {{ if not (isEmpty .ID) }}
|
{{ range . }} {{ if not (isEmpty .ID) }}
|
||||||
<div class="artwork-thumbnail-small artwork-thumbnail artwork-mobile">
|
<div class="artwork-thumbnail-small artwork-thumbnail artwork-mobile">
|
||||||
{{ template "thumbnail-dt.html" . }} {{ template "thumbnail-tt.html" . }} {{
|
{{ template "thumbnail-dt" . }} {{ template "thumbnail-tt" . }} {{ template
|
||||||
template "thumbnail-at.html" . }}
|
"thumbnail-at" . }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }} {{ end }}
|
{{ end }} {{ end }}
|
||||||
|
|
Loading…
Reference in a new issue