summaryrefslogtreecommitdiff
path: root/main.go
diff options
from:
to:
context:
space:
mode:
authorGravatar SayaAndy <saya.andy@posteo.com> 2025-08-26 00:39:22 +0700
committerGravatar SayaAndy <saya.andy@posteo.com> 2025-08-26 00:39:22 +0700
commit5ed2499a1d8806fe78369b5b492d7990218131c9 (patch)
tree0a9e0548aa145986b654af81554f16c8cf544c41 /main.go
parentb815b74d7a943d1f71a0ddcf6b343d3958d2b97a (diff)
downloadweb-5ed2499a1d8806fe78369b5b492d7990218131c9.tar.gz
web-5ed2499a1d8806fe78369b5b492d7990218131c9.zip
feat: client hash cache
feat: add local config feat: create a volume for data (for the future) format: unname unused vars
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.go b/main.go
index 566e796..9f95c04 100644
--- a/main.go
+++ b/main.go
@@ -68,7 +68,9 @@ func main() {
localization[lang.Name] = localeCfg
}
- app := fiber.New(fiber.Config{})
+ app := fiber.New(fiber.Config{
+ ProxyHeader: "X-Forwarded-For",
+ })
app.Use(redirect.New(redirect.Config{
Rules: map[string]string{
@@ -78,6 +80,8 @@ func main() {
StatusCode: 301,
}))
+ router.CCache = router.NewClientCache([]byte(cfg.Auth.Salt))
+
app.Get("/", router.Root(cfg.AvailableLanguages))
app.Get("/:lang/map", router.Lang_Map(localization, availableLanguages, b2Client))
app.Get("/:lang/blog", router.Lang_Blog(localization, availableLanguages, b2Client))