1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
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, api, cdn, gateway } = 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,
endpoints: {
defaultApiVersion: api.defaultVersion ?? 9,
apiEndpoint: api.endpointPublic ?? "/api",
cdnEndpoint: cdn.endpointPublic ?? "/",
gatewayEndpoint: gateway.endpointPublic ?? "/",
},
},
});
});
export default router;
|