aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com>2021-11-19 20:35:09 -0400
committerFChannel <>2022-06-19 12:53:29 -0700
commit0a90446114512da05273e2c53b8c6fe5303a824e (patch)
tree37140c92bb384ed4fb0f20c791dddfd9f7abfc58
parentd5003b51a4ca7ed2c13ffd23b051ea31c8836ba0 (diff)
i just wasted two hours
-rw-r--r--main.go16
-rw-r--r--routes/actor.go2
2 files changed, 7 insertions, 11 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()
diff --git a/routes/actor.go b/routes/actor.go
index 7fc9cb5..d54b530 100644
--- a/routes/actor.go
+++ b/routes/actor.go
@@ -11,7 +11,7 @@ func ActorIndex(c *fiber.Ctx) error {
func ActorPostGet(c *fiber.Ctx) error {
// STUB
// TODO: PostGet
- return c.SendString("actor post")
+ return c.SendString("actor post get")
}
func ActorInbox(c *fiber.Ctx) error {