aggiunto e testato quasar apps
This commit is contained in:
27
internal/controllers/private_controller.go
Normal file
27
internal/controllers/private_controller.go
Normal file
@@ -0,0 +1,27 @@
|
||||
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"))
|
||||
}
|
||||
Reference in New Issue
Block a user