diff options
author | FChannel <> | 2022-04-24 00:46:49 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 3db517715bef6a53225c5c3c06e8fc5fd0bf71e3 (patch) | |
tree | 9aa7fbcb12f2ec8d0e4e66cd85ace058e38dd32d /main.go | |
parent | 9718d34a757b66917747c1c4acfb9b35d154625b (diff) |
basic pass over view posts, post, catalog and manage page connections
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 54 |
1 files changed, 22 insertions, 32 deletions
@@ -105,6 +105,8 @@ func main() { TemplateFunctions(template) + template.Reload(true) + app := fiber.New(fiber.Config{ AppName: "FChannel", Views: template, @@ -128,25 +130,6 @@ func main() { 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 { |