mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-22 10:22:39 +01:00
Move endpoints from ping -> policies/instance/domains (#933)
This commit is contained in:
parent
bec4a61c60
commit
d857af980c
@ -5,7 +5,7 @@ import { Config } from "@fosscord/util";
|
|||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.get("/", route({}), (req: Request, res: Response) => {
|
router.get("/", route({}), (req: Request, res: Response) => {
|
||||||
const { general, api, cdn, gateway } = Config.get();
|
const { general } = Config.get();
|
||||||
res.send({
|
res.send({
|
||||||
ping: "pong!",
|
ping: "pong!",
|
||||||
instance: {
|
instance: {
|
||||||
@ -19,13 +19,6 @@ router.get("/", route({}), (req: Request, res: Response) => {
|
|||||||
|
|
||||||
frontPage: general.frontPage,
|
frontPage: general.frontPage,
|
||||||
tosPage: general.tosPage,
|
tosPage: general.tosPage,
|
||||||
endpoints: {
|
|
||||||
defaultApiVersion: api.defaultVersion ?? 9,
|
|
||||||
apiEndpoint: api.endpointPublic ?? "/api",
|
|
||||||
cdnEndpoint: cdn.endpointPublic ?? "/",
|
|
||||||
gatewayEndpoint:
|
|
||||||
gateway.endpointPublic ?? "ws://localhost:3001",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -5,7 +5,7 @@ import { config } from "dotenv";
|
|||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||||
const { cdn, gateway } = Config.get();
|
const { cdn, gateway, api } = Config.get();
|
||||||
|
|
||||||
const IdentityForm = {
|
const IdentityForm = {
|
||||||
cdn: cdn.endpointPublic || process.env.CDN || "http://localhost:3001",
|
cdn: cdn.endpointPublic || process.env.CDN || "http://localhost:3001",
|
||||||
@ -13,6 +13,8 @@ router.get("/", route({}), async (req: Request, res: Response) => {
|
|||||||
gateway.endpointPublic ||
|
gateway.endpointPublic ||
|
||||||
process.env.GATEWAY ||
|
process.env.GATEWAY ||
|
||||||
"ws://localhost:3002",
|
"ws://localhost:3002",
|
||||||
|
defaultApiVersion: api.defaultVersion ?? 9,
|
||||||
|
apiEndpoint: api.endpointPublic ?? "/api",
|
||||||
};
|
};
|
||||||
|
|
||||||
res.json(IdentityForm);
|
res.json(IdentityForm);
|
||||||
|
Loading…
Reference in New Issue
Block a user