mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-22 02:12:40 +01:00
mmm bodyparser
This commit is contained in:
parent
093c23feae
commit
cb2c2f244f
@ -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;
|
||||
|
9
src/activitypub/routes/channel/#channel_id/inbox.ts
Normal file
9
src/activitypub/routes/channel/#channel_id/inbox.ts
Normal file
@ -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);
|
||||
});
|
Loading…
Reference in New Issue
Block a user