summaryrefslogtreecommitdiff
path: root/src/app.ts
diff options
context:
space:
mode:
authorRaphael Kabo <raphaelkabo@hey.com>2023-10-07 14:30:24 +0100
committerRaphael Kabo <raphaelkabo@hey.com>2023-10-07 15:38:47 +0100
commitb795d07ed7a1b705b72b171f8e8de267a720223b (patch)
treeb8ae3df8dbb89f839f29328e817f030dc22b89f8 /src/app.ts
parent9341659fd7a791d77454dd33743e42d952dbd202 (diff)
refactor: event form and api routes
Diffstat (limited to 'src/app.ts')
-rwxr-xr-xsrc/app.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/app.ts b/src/app.ts
index 5b01b3c..30cf02d 100755
--- a/src/app.ts
+++ b/src/app.ts
@@ -3,9 +3,15 @@ import hbs from "express-handlebars";
import routes from "./routes.js";
import frontend from "./routes/frontend.js";
+import activitypub from "./routes/activitypub.js";
+import event from "./routes/event.js";
+
+import { initEmailService } from "./lib/email.js";
const app = express();
+app.locals.sendEmails = initEmailService();
+
// View engine //
const hbsInstance = hbs.create({
defaultLayout: "main",
@@ -37,11 +43,15 @@ app.set("hbsInstance", hbsInstance);
app.use(express.static("public"));
// Body parser //
-app.use(express.json({ type: "application/activity+json" })); // support json encoded bodies
+app.use(express.json({ type: "application/activity+json" }));
+app.use(express.json({ type: "application/ld+json" }));
+app.use(express.json({ type: "application/json" }));
app.use(express.urlencoded({ extended: true }));
// Router //
app.use("/", frontend);
+app.use("/", activitypub);
+app.use("/", event);
app.use("/", routes);
export default app;