Feature: logger and prefork
This commit is contained in:
parent
6c42f6b6b9
commit
d1bbc9b150
6
main.go
6
main.go
|
@ -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")
|
||||
|
|
|
@ -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" }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue