summaryrefslogtreecommitdiff
path: root/src/app.ts
diff options
context:
space:
mode:
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;