summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-08-14 23:35:14 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-08-14 23:35:14 +1000
commitcb2c2f244f67f24141c28003197481a73f07d8a5 (patch)
treebd8e88d60157c405c54ebcd069913a310709d230 /src
parenti love commit messages (diff)
downloadserver-cb2c2f244f67f24141c28003197481a73f07d8a5.tar.xz
mmm bodyparser
Diffstat (limited to 'src')
-rw-r--r--src/activitypub/Server.ts10
-rw-r--r--src/activitypub/routes/channel/#channel_id/inbox.ts9
2 files changed, 18 insertions, 1 deletions
diff --git a/src/activitypub/Server.ts b/src/activitypub/Server.ts

index 373d7390..84f842e0 100644 --- a/src/activitypub/Server.ts +++ b/src/activitypub/Server.ts
@@ -5,6 +5,7 @@ import { initDatabase, registerRoutes, } from "@spacebar/util"; +import bodyParser from "body-parser"; import { Request, Response, Router } from "express"; import { Server, ServerOptions } from "lambert-server"; import path from "path"; @@ -27,7 +28,14 @@ export class APServer extends Server { this.app.set("json replacer", JSONReplacer); this.app.use(CORS); - this.app.use(BodyParser({ inflate: true, limit: "10mb" })); + this.app.use( + BodyParser({ + inflate: true, + limit: "10mb", + type: "application/activity+json", + }), + ); + this.app.use(bodyParser.urlencoded({ extended: true })); const api = Router(); const app = this.app; diff --git a/src/activitypub/routes/channel/#channel_id/inbox.ts b/src/activitypub/routes/channel/#channel_id/inbox.ts new file mode 100644
index 00000000..01e267e7 --- /dev/null +++ b/src/activitypub/routes/channel/#channel_id/inbox.ts
@@ -0,0 +1,9 @@ +import { route } from "@spacebar/api"; +import { Router } from "express"; + +const router = Router(); +export default router; + +router.post("/", route({}), async (req, res) => { + console.log(req.body); +});