diff options
author | Thesourtimes <cckhmck@gmail.com> | 2021-11-18 22:15:05 +0300 |
---|---|---|
committer | Thesourtimes <cckhmck@gmail.com> | 2021-11-18 22:15:05 +0300 |
commit | 7681ea6d8ee7ce3af6a7287b22a60b214d9e0629 (patch) | |
tree | e8e5a5f5cbdc1a732544127c9f2b3101723912fc /api | |
parent | Add image field (diff) | |
download | server-7681ea6d8ee7ce3af6a7287b22a60b214d9e0629.tar.xz |
Fix the minor issues on route
Diffstat (limited to 'api')
-rw-r--r-- | api/src/middlewares/Authentication.ts | 4 | ||||
-rw-r--r-- | api/src/routes/policies/instance/domains.ts | 14 | ||||
-rw-r--r-- | api/src/routes/policies/instance/index.ts (renamed from api/src/routes/policies/instance/meta.ts) | 6 | ||||
-rw-r--r-- | api/src/routes/policies/instance/limits.ts | 4 |
4 files changed, 16 insertions, 12 deletions
diff --git a/api/src/middlewares/Authentication.ts b/api/src/middlewares/Authentication.ts index e6df6eeb..8fbdd2b7 100644 --- a/api/src/middlewares/Authentication.ts +++ b/api/src/middlewares/Authentication.ts @@ -11,7 +11,9 @@ export const NO_AUTHORIZATION_ROUTES = [ "/experiments", "/-/readyz", "/-/healthz", - "/policies/instance/", + "/science", + "/track", + "/policies/instance", /\/guilds\/\d+\/widget\.(json|png)/ ]; diff --git a/api/src/routes/policies/instance/domains.ts b/api/src/routes/policies/instance/domains.ts index b68763cc..20cd07ba 100644 --- a/api/src/routes/policies/instance/domains.ts +++ b/api/src/routes/policies/instance/domains.ts @@ -3,14 +3,16 @@ 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) + const { cdn, gateway } = Config.get(); + + const IdentityForm = { + cdn: cdn.endpointPublic || process.env.CDN || "http://localhost:3001", + gateway: gateway.endpointPublic || process.env.GATEWAY || "ws://localhost:3002" + }; + + res.json(IdentityForm); }); export default router; diff --git a/api/src/routes/policies/instance/meta.ts b/api/src/routes/policies/instance/index.ts index 7a998487..e3da014f 100644 --- a/api/src/routes/policies/instance/meta.ts +++ b/api/src/routes/policies/instance/index.ts @@ -1,12 +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) + const { general } = Config.get(); + res.json(general); }); export default router; diff --git a/api/src/routes/policies/instance/limits.ts b/api/src/routes/policies/instance/limits.ts index 912908b7..7de1476b 100644 --- a/api/src/routes/policies/instance/limits.ts +++ b/api/src/routes/policies/instance/limits.ts @@ -2,10 +2,10 @@ 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) + const { limits } = Config.get(); + res.json(limits); }); export default router; |