aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/main.go b/main.go
index 2f8131d..b7c0c38 100644
--- a/main.go
+++ b/main.go
@@ -12,6 +12,7 @@ import (
"github.com/FChannel0/FChannel-Server/util"
"github.com/FChannel0/FChannel-Server/webfinger"
"github.com/gofiber/fiber/v2"
+ "github.com/gofiber/fiber/v2/middleware/logger"
"github.com/gofiber/template/html"
// "github.com/gofrs/uuid"
@@ -98,13 +99,6 @@ func main() {
}
}
- // Allow access to public media folder
- fileServer := http.FileServer(http.Dir("./public"))
- http.Handle("/public/", http.StripPrefix("/public", neuter(fileServer)))
-
- javascriptFiles := http.FileServer(http.Dir("./static"))
- http.Handle("/static/", http.StripPrefix("/static", neuter(javascriptFiles)))
-
/* Routing and templates */
template := html.New("./views", ".html")
@@ -116,6 +110,11 @@ func main() {
Views: template,
})
+ app.Use(logger.New())
+
+ app.Static("/static", "./views")
+ app.Static("/public", "./public")
+
/*
Main actor
*/
@@ -241,9 +240,6 @@ func main() {
// 404 handler
app.Use(routes.NotFound)
- app.Static("/public", "./public")
- app.Static("/static", "./views")
-
fmt.Println("Mod key: " + config.Key)
PrintAdminAuth()