From 3db517715bef6a53225c5c3c06e8fc5fd0bf71e3 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 24 Apr 2022 00:46:49 -0700 Subject: basic pass over view posts, post, catalog and manage page connections --- main.go | 54 ++++++++++++++++++++++-------------------------------- 1 file changed, 22 insertions(+), 32 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 3049d71..a08ed57 100644 --- a/main.go +++ b/main.go @@ -105,6 +105,8 @@ func main() { TemplateFunctions(template) + template.Reload(true) + app := fiber.New(fiber.Config{ AppName: "FChannel", Views: template, @@ -127,25 +129,6 @@ func main() { app.Get("/following", routes.Following) app.Get("/followers", routes.Followers) - /* - Board actor - */ - - app.Get("/:actor", routes.OutboxGet) - app.Get("/:actor/catalog", routes.CatalogGet) - - app.Get("/:actor/:post", routes.PostGet) - app.Get("/post", routes.ActorPost) - - app.Get("/:actor/inbox", routes.ActorInbox) - app.Get("/:actor/outbox", routes.ActorOutbox) - - app.Get("/:actor/following", routes.ActorFollowing) - app.Get("/:actor/followers", routes.ActorFollowers) - - app.Get("/:actor/reported", routes.ActorReported) - app.Get("/:actor/archive", routes.ActorArchive) - /* Admin routes */ @@ -238,7 +221,26 @@ func main() { return c.SendStatus(404) }) - // 404 handler + /* + Board actor + */ + + app.Get("/:actor", routes.OutboxGet) + app.Get("/:actor/catalog", routes.CatalogGet) + + app.Get("/:actor/:post", routes.PostGet) + app.Get("/post", routes.ActorPost) + + app.Get("/:actor/inbox", routes.ActorInbox) + app.Get("/:actor/outbox", routes.ActorOutbox) + + app.Get("/:actor/following", routes.ActorFollowing) + app.Get("/:actor/followers", routes.ActorFollowers) + + app.Get("/:actor/reported", routes.ActorReported) + app.Get("/:actor/archive", routes.ActorArchive) + + //404 handler app.Use(routes.NotFound) fmt.Println("Mod key: " + config.Key) @@ -293,18 +295,6 @@ func CreateNewActor(board string, prefName string, summary string, authReq []str return actor } -func GetActorInfo(w http.ResponseWriter, id string) error { - actor, err := db.GetActorFromDB(id) - if err != nil { - return err - } - - enc, _ := json.MarshalIndent(actor, "", "\t") - w.Header().Set("Content-Type", "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") - _, err = w.Write(enc) - return err -} - func GetActorPost(w http.ResponseWriter, path string) error { collection, err := db.GetCollectionFromPath(config.Domain + "" + path) if err != nil { -- cgit v1.2.3