diff options
| author | Bobby <[email protected]> | 2025-12-19 18:01:24 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-12-19 18:01:24 +0530 |
| commit | b1bfec1ce2987d9fe0cc52e5ae9115977fdf8c24 (patch) | |
| tree | 7080b7dc97522ffe0837a1e0b2965489d7e67664 /processors | |
| parent | 767297e28d47ee9cf3722054e41caa837f0e68d2 (diff) | |
| download | lain-b1bfec1ce2987d9fe0cc52e5ae9115977fdf8c24.tar.xz lain-b1bfec1ce2987d9fe0cc52e5ae9115977fdf8c24.zip | |
added utils, templates, routes, types, middleware, processors and a whole lot of things for a basic login page
Diffstat (limited to 'processors')
| -rw-r--r-- | processors/metadata.go | 18 | ||||
| -rw-r--r-- | processors/processors.go | 8 | ||||
| -rw-r--r-- | processors/request.go | 12 |
3 files changed, 38 insertions, 0 deletions
diff --git a/processors/metadata.go b/processors/metadata.go new file mode 100644 index 0000000..96fcdb2 --- /dev/null +++ b/processors/metadata.go @@ -0,0 +1,18 @@ +package processors + +import ( + "lain/config" + + "github.com/gofiber/fiber/v2" +) + +const defaultTitle = "Lain | Present day, present time!" + +func metadata(ctx *fiber.Ctx) error { + ctx.Locals("Title", defaultTitle) + ctx.Locals("AppName", config.Server.AppName) + ctx.Locals("AppDescription", config.Server.AppDescription) + ctx.Locals("AppEngine", config.Server.AppEngine) + + return ctx.Next() +} diff --git a/processors/processors.go b/processors/processors.go new file mode 100644 index 0000000..d56cbde --- /dev/null +++ b/processors/processors.go @@ -0,0 +1,8 @@ +package processors + +import "github.com/gofiber/fiber/v2" + +func Initialize(app *fiber.App) { + app.Use(metadata) + app.Use(request) +} diff --git a/processors/request.go b/processors/request.go new file mode 100644 index 0000000..4372693 --- /dev/null +++ b/processors/request.go @@ -0,0 +1,12 @@ +package processors + +import ( + "lain/utils/meta" + + "github.com/gofiber/fiber/v2" +) + +func request(ctx *fiber.Ctx) error { + ctx.Locals("Request", meta.BuildRequest(ctx)) + return ctx.Next() +} |
