1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-06 10:52:31 +01:00

Add instance route

This commit is contained in:
uurgothat 2021-11-17 22:28:22 +03:00
parent ecb1f0f748
commit 39aebb2cfc
5 changed files with 46 additions and 0 deletions

View File

@ -11,6 +11,7 @@ export const NO_AUTHORIZATION_ROUTES = [
"/experiments",
"/-/readyz",
"/-/healthz",
"/policies/instance/",
/\/guilds\/\d+\/widget\.(json|png)/
];

View File

@ -0,0 +1,16 @@
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
import { Config } from "@fosscord/util";
import { config } from "dotenv"
const router = Router();
const { cdn } = Config.get();
const IdentityForm = {
cdn: cdn.endpointPublic || process.env.CDN || "http://localhost:3001",
}
router.get("/",route({}), async (req: Request, res: Response) => {
res.json(IdentityForm)
});
export default router;

View File

@ -0,0 +1,11 @@
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
import { Config } from "@fosscord/util";
const router = Router();
const { limits } = Config.get();
router.get("/",route({}), async (req: Request, res: Response) => {
res.json(limits)
});
export default router;

View File

@ -0,0 +1,12 @@
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
import { Config } from "@fosscord/util";
const router = Router();
const { general } = Config.get();
router.get("/",route({}), async (req: Request, res: Response) => {
res.json(general)
});
export default router;

View File

@ -49,6 +49,9 @@ export interface ConfigValue {
endpointPrivate: string | null;
};
general: {
instanceName: string;
instanceDescription: string | null;
frontPage: string | null;
instanceId: string;
};
limits: {
@ -180,7 +183,10 @@ export const DefaultConfigOptions: ConfigValue = {
endpointPublic: null,
},
general: {
instanceName: "Fosscord Instance",
instanceDescription: "This is a Fosscord instance made in pre-relase days",
instanceId: Snowflake.generate(),
frontPage: null
},
limits: {
user: {