From 240076a5d8ea85dd9c235fd0a1f5bbaed6b55c6e Mon Sep 17 00:00:00 2001
From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com>
Date: Sun, 19 Mar 2023 21:43:10 +1100
Subject: Add basic information page to /
---
assets/public/index.html | 64 ++++++++++++++++++++++++++++++++++++++++++++++++
src/api/Server.ts | 11 +++++++++
2 files changed, 75 insertions(+)
create mode 100644 assets/public/index.html
diff --git a/assets/public/index.html b/assets/public/index.html
new file mode 100644
index 00000000..2fa07ca9
--- /dev/null
+++ b/assets/public/index.html
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+ Fosscord Server
+
+
+
+
+
+
+
+
+
+
+
+
+
Welcome!
+
If you're viewing this page, that means you've successfully set up your very own Fosscord instance!
+
For information on how to configure your shiny new setup, you should visit our documentation
+
For information on how to connect and use your instance, click here
+
+
+
+
\ No newline at end of file
diff --git a/src/api/Server.ts b/src/api/Server.ts
index 49229494..dbe61444 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,8 @@ export class FosscordServer extends Server {
app.use("/api/v9", api);
app.use("/api", api); // allow unversioned requests
+ app.get("/", express.static(PUBLIC_ASSETS_FOLDER));
+
this.app.use(ErrorHandler);
Sentry.errorHandler(this.app);
--
cgit 1.4.1