summaryrefslogtreecommitdiffci
path: root/internal/router/root.go
diff options
from:
to:
context:
space:
mode:
authorGravatar SayaAndy <saya.andy@posteo.com> 2025-10-23 01:15:26 +0700
committerGravatar SayaAndy <saya.andy@posteo.com> 2025-10-23 01:15:26 +0700
commit0d261d2f7d080b610f50102576073e334a89e8cb (patch)
tree3f86877a48cdb02486d6b5cb771a420c82c7eacf /internal/router/root.go
parent695889f42896c1e3f1290a588ac1c5483d0124f0 (diff)
downloadweb-0d261d2f7d080b610f50102576073e334a89e8cb.tar.gz
web-0d261d2f7d080b610f50102576073e334a89e8cb.zip
feat: email linking
Diffstat (limited to 'internal/router/root.go')
-rw-r--r--internal/router/root.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/internal/router/root.go b/internal/router/root.go
deleted file mode 100644
index f4a0692..0000000
--- a/internal/router/root.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package router
-
-import (
- "log/slog"
-
- "github.com/SayaAndy/saya-today-web/config"
- "github.com/gofiber/fiber/v2"
-)
-
-func init() {
- tm.Add("index", "views/index.html")
-}
-
-func Root(localeCfg []config.AvailableLanguageConfig) func(c *fiber.Ctx) error {
- return func(c *fiber.Ctx) error {
- content, err := tm.Render("index", fiber.Map{
- "AvailableLanguages": localeCfg,
- })
- if err != nil {
- slog.Warn("failed to generate page", slog.String("page", "/"), slog.String("error", err.Error()))
- c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)
- return c.Status(fiber.ErrInternalServerError.Code).SendString("failed to generate page")
- }
-
- return c.Type("html").Send(content)
- }
-}