1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-25 11:43:07 +01:00

Add basic info in ping

Signed-off-by: TheArcaneBrony <myrainbowdash949@gmail.com>
This commit is contained in:
TheArcaneBrony 2023-01-14 19:55:19 +01:00
parent f2f71cafdf
commit 3bb002eb88
No known key found for this signature in database
GPG Key ID: 32FC5AAADAD75A22
2 changed files with 8 additions and 1 deletions

View File

@ -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 ?? "/",
},
},
});
});

View File

@ -2,4 +2,5 @@ export class ApiConfiguration {
defaultVersion: string = "9";
activeVersions: string[] = ["6", "7", "8", "9"];
useFosscordEnhancements: boolean = true;
endpointPublic: string = "/api";
}