summary refs log tree commit diff
path: root/src/api/routes/ping.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/routes/ping.ts')
-rw-r--r--src/api/routes/ping.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/api/routes/ping.ts b/src/api/routes/ping.ts
new file mode 100644
index 00000000..3c1da2c3
--- /dev/null
+++ b/src/api/routes/ping.ts
@@ -0,0 +1,26 @@
+import { Router, Response, Request } from "express";
+import { route } from "@fosscord/api";
+import { Config } from "@fosscord/util";
+
+const router = Router();
+
+router.get("/", route({}), (req: Request, res: Response) => {
+	const { general } = Config.get();
+	res.send({
+		ping: "pong!",
+		instance: {
+			id: general.instanceId,
+			name: general.instanceName,
+			description: general.instanceDescription,
+			image: general.image,
+
+			correspondenceEmail: general.correspondenceEmail,
+			correspondenceUserID: general.correspondenceUserID,
+
+			frontPage: general.frontPage,
+			tosPage: general.tosPage,
+		},
+	});
+});
+
+export default router;