mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-06 10:52:31 +01:00
Minor API work
This commit is contained in:
parent
9b9e6cfa9d
commit
6e48883354
@ -3,17 +3,25 @@ import { HTTPError } from "lambert-server";
|
|||||||
import { checkToken, Config, Rights } from "@fosscord/util";
|
import { checkToken, Config, Rights } from "@fosscord/util";
|
||||||
|
|
||||||
export const NO_AUTHORIZATION_ROUTES = [
|
export const NO_AUTHORIZATION_ROUTES = [
|
||||||
|
//Authentication routes
|
||||||
"/auth/login",
|
"/auth/login",
|
||||||
"/auth/register",
|
"/auth/register",
|
||||||
|
"/auth/location-metadata",
|
||||||
|
//Routes with a seperate auth system
|
||||||
"/webhooks/",
|
"/webhooks/",
|
||||||
|
//Public information endpoints
|
||||||
"/ping",
|
"/ping",
|
||||||
"/gateway",
|
"/gateway",
|
||||||
"/experiments",
|
"/experiments",
|
||||||
|
//Public kubernetes integration
|
||||||
"/-/readyz",
|
"/-/readyz",
|
||||||
"/-/healthz",
|
"/-/healthz",
|
||||||
|
//Client nalytics
|
||||||
"/science",
|
"/science",
|
||||||
"/track",
|
"/track",
|
||||||
|
//Public policy pages
|
||||||
"/policies/instance",
|
"/policies/instance",
|
||||||
|
//Asset delivery
|
||||||
/\/guilds\/\d+\/widget\.(json|png)/
|
/\/guilds\/\d+\/widget\.(json|png)/
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -87,6 +87,7 @@ export default function TestClient(app: Application) {
|
|||||||
res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24);
|
res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24);
|
||||||
res.set("content-type", "text/html");
|
res.set("content-type", "text/html");
|
||||||
|
|
||||||
|
if(req.url.startsWith("/api")) return;
|
||||||
if (req.url.startsWith("/invite")) return res.send(html.replace("9b2b7f0632acd0c5e781", "9f24f709a3de09b67c49"));
|
if (req.url.startsWith("/invite")) return res.send(html.replace("9b2b7f0632acd0c5e781", "9f24f709a3de09b67c49"));
|
||||||
|
|
||||||
res.send(html);
|
res.send(html);
|
||||||
|
@ -26,9 +26,9 @@ dirs.forEach((a) => {
|
|||||||
if (verbose) console.log(`Copied ${"../" + a + "/dist"} -> ${"dist/" + a + "/src"}!`);
|
if (verbose) console.log(`Copied ${"../" + a + "/dist"} -> ${"dist/" + a + "/src"}!`);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Copying src files done");
|
console.log("[1/2] Copying src files done");
|
||||||
if (!argv.includes("copyonly")) {
|
if (!argv.includes("copyonly")) {
|
||||||
console.log("Compiling src files ...");
|
console.log("[2/2] Compiling src files ...");
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
execSync(
|
execSync(
|
||||||
|
Loading…
Reference in New Issue
Block a user