summary refs log tree commit diff
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-01-14 19:55:19 +0100
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-01-14 19:55:19 +0100
commit3bb002eb88d481e949c00d8bc85aded7c9825c55 (patch)
tree5bdc5336dbe2e656ac0ec4a3811cd933ae949cbc
parentUpdate openapi (diff)
downloadserver-3bb002eb88d481e949c00d8bc85aded7c9825c55.tar.xz
Add basic info in ping
Signed-off-by: TheArcaneBrony <myrainbowdash949@gmail.com>
-rw-r--r--src/api/routes/ping.ts8
-rw-r--r--src/util/config/types/ApiConfiguration.ts1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/api/routes/ping.ts b/src/api/routes/ping.ts
index 3c1da2c3..ff79399c 100644
--- a/src/api/routes/ping.ts
+++ b/src/api/routes/ping.ts
@@ -5,7 +5,7 @@ import { Config } from "@fosscord/util";
 const router = Router();
 
 router.get("/", route({}), (req: Request, res: Response) => {
-	const { general } = Config.get();
+	const { general, api, cdn, gateway } = Config.get();
 	res.send({
 		ping: "pong!",
 		instance: {
@@ -19,6 +19,12 @@ router.get("/", route({}), (req: Request, res: Response) => {
 
 			frontPage: general.frontPage,
 			tosPage: general.tosPage,
+			endpoints: {
+				defaultApiVersion: api.defaultVersion ?? 9,
+				apiEndpoint: api.endpointPublic ?? "/api",
+				cdnEndpoint: cdn.endpointPublic ?? "/",
+				gatewayEndpoint: gateway.endpointPublic ?? "/",
+			},
 		},
 	});
 });
diff --git a/src/util/config/types/ApiConfiguration.ts b/src/util/config/types/ApiConfiguration.ts
index 442a5986..64d9e6d7 100644
--- a/src/util/config/types/ApiConfiguration.ts
+++ b/src/util/config/types/ApiConfiguration.ts
@@ -2,4 +2,5 @@ export class ApiConfiguration {
 	defaultVersion: string = "9";
 	activeVersions: string[] = ["6", "7", "8", "9"];
 	useFosscordEnhancements: boolean = true;
+	endpointPublic: string = "/api";
 }