Socialify

Folder ..

Viewing router.go
22 lines (16 loc) • 419.0 B

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
package router

import (
	"majin/internal/auth"
	"majin/templates"

	"github.com/gofiber/fiber/v2"
)

func Initialize(router *fiber.App) {

	mail := router.Group("/mail", auth.RequireAuth)

	mail.Get("/", func(c *fiber.Ctx) error {
		return c.SendString("You are viewing your mail")
	})

	router.Use(func(c *fiber.Ctx) error {
		c.Status(fiber.StatusNotFound)
		return templates.NotFound().Render(c.Context(), c)
	})
}