1 files changed, 13 insertions, 0 deletions
diff --git a/src/api/Server.ts b/src/api/Server.ts
index 49229494..6ec531e0 100644
--- a/src/api/Server.ts
+++ b/src/api/Server.ts
@@ -38,6 +38,15 @@ import { ErrorHandler } from "./middlewares/ErrorHandler";
import { initRateLimits } from "./middlewares/RateLimit";
import { initTranslation } from "./middlewares/Translation";
import { initInstance } from "./util/handlers/Instance";
+import express from "express";
+
+const PUBLIC_ASSETS_FOLDER = path.join(
+ __dirname,
+ "..",
+ "..",
+ "assets",
+ "public",
+);
export type FosscordServerOptions = ServerOptions;
@@ -126,6 +135,10 @@ export class FosscordServer extends Server {
app.use("/api/v9", api);
app.use("/api", api); // allow unversioned requests
+ app.get("/", (req, res) =>
+ res.sendFile(path.join(PUBLIC_ASSETS_FOLDER, "index.html")),
+ );
+
this.app.use(ErrorHandler);
Sentry.errorHandler(this.app);
|