Feature: logger and prefork

This commit is contained in:
VnPower 2023-06-12 12:10:54 +07:00
parent 6c42f6b6b9
commit d1bbc9b150
Signed by: vnpower
GPG key ID: 881DE3DEB966106C
3 changed files with 11 additions and 7 deletions

View file

@ -6,6 +6,7 @@ import (
"pixivfe/views"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
"github.com/gofiber/template/html/v2"
)
@ -16,9 +17,12 @@ func setupRouter() *fiber.App {
handler.GetTemplateFunctions(engine)
server := fiber.New(fiber.Config{
Views: engine,
Views: engine,
Prefork: true,
})
server.Use(logger.New())
// Static files
server.Static("/favicon.ico", "./template/favicon.ico")
server.Static("css/", "./template/css")

View file

@ -1,4 +1,4 @@
{{ template "header.html" .Title }} {{ $parent := . }}
{{ template "header" .Title }} {{ $parent := . }}
<div class="container">
<div class="artwork-page">
{{ with .Illust }}
@ -43,7 +43,7 @@
<div class="thumbnail-container">
{{ range $parent.Artist.Artworks }}
<div class="artwork-thumbnail-small artwork-thumbnail">
{{ template "thumbnail-dt.html" . }}
{{ template "thumbnail-dt" . }}
</div>
{{ end }}
</div>
@ -76,7 +76,7 @@
{{ end }}
</div>
<h2>Related works</h2>
<div>{{ template "small-tn.html" .Related }}</div>
<div>{{ template "small-tn" .Related }}</div>
</div>
{{ template "footer.html" }}
{{ template "footer" }}

View file

@ -1,6 +1,6 @@
{{ range . }} {{ if not (isEmpty .ID) }}
<div class="artwork-thumbnail-small artwork-thumbnail artwork-mobile">
{{ template "thumbnail-dt.html" . }} {{ template "thumbnail-tt.html" . }} {{
template "thumbnail-at.html" . }}
{{ template "thumbnail-dt" . }} {{ template "thumbnail-tt" . }} {{ template
"thumbnail-at" . }}
</div>
{{ end }} {{ end }}