Files
trustcontact/internal/controllers/private_controller.go
2026-03-01 20:42:27 +01:00

28 lines
606 B
Go

package controllers
import (
"path/filepath"
"github.com/gofiber/fiber/v2"
)
type PrivateController struct {
spaDir string
}
func NewPrivateController(spaDir string) *PrivateController {
return &PrivateController{spaDir: spaDir}
}
func (ac *PrivateController) Dashboard(c *fiber.Ctx) error {
return c.SendFile(filepath.Join(ac.spaDir, "index.html"))
}
func (ac *PrivateController) Fallback(c *fiber.Ctx) error {
return c.SendFile(filepath.Join(ac.spaDir, "index.html"))
}
func (ac *PrivateController) Favicon(c *fiber.Ctx) error {
return c.SendFile(filepath.Join(ac.spaDir, "favicon.ico"))
}