summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Chrome <christophercookman@gmail.com>2023-01-15 19:46:41 -0700
committerGitHub <noreply@github.com>2023-01-16 13:46:41 +1100
commitd857af980c83800f1b083d0ce463ad0221ada690 (patch)
tree6dc406d8e71f2a408d5993977b5a6292e6168271
parentFix some default value (diff)
downloadserver-d857af980c83800f1b083d0ce463ad0221ada690.tar.xz
Move endpoints from ping -> policies/instance/domains (#933)
-rw-r--r--src/api/routes/ping.ts9
-rw-r--r--src/api/routes/policies/instance/domains.ts4
2 files changed, 4 insertions, 9 deletions
diff --git a/src/api/routes/ping.ts b/src/api/routes/ping.ts
index 9bf8c243..3c1da2c3 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, api, cdn, gateway } = Config.get();
+	const { general } = Config.get();
 	res.send({
 		ping: "pong!",
 		instance: {
@@ -19,13 +19,6 @@ 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 ?? "ws://localhost:3001",
-			},
 		},
 	});
 });
diff --git a/src/api/routes/policies/instance/domains.ts b/src/api/routes/policies/instance/domains.ts
index f22eac17..0acecb9a 100644
--- a/src/api/routes/policies/instance/domains.ts
+++ b/src/api/routes/policies/instance/domains.ts
@@ -5,7 +5,7 @@ import { config } from "dotenv";
 const router = Router();
 
 router.get("/", route({}), async (req: Request, res: Response) => {
-	const { cdn, gateway } = Config.get();
+	const { cdn, gateway, api } = Config.get();
 
 	const IdentityForm = {
 		cdn: cdn.endpointPublic || process.env.CDN || "http://localhost:3001",
@@ -13,6 +13,8 @@ router.get("/", route({}), async (req: Request, res: Response) => {
 			gateway.endpointPublic ||
 			process.env.GATEWAY ||
 			"ws://localhost:3002",
+		defaultApiVersion: api.defaultVersion ?? 9,
+		apiEndpoint: api.endpointPublic ?? "/api",
 	};
 
 	res.json(IdentityForm);