I can't be bothered to even explain what happene here

This commit is contained in:
2025-02-07 23:18:04 -05:00
parent d982567c7b
commit bc3443b1dc
21 changed files with 994 additions and 177 deletions

40
src/routes/nameserver.ts Normal file
View File

@@ -0,0 +1,40 @@
import { APIUtils } from "../apiutils.ts";
import { Config } from "../config.ts";
const config = Config.getConfig() as Config.GalvanicConfiguration;
const protocol = config.web.secureNameserverHost ? 'https' : 'http';
export const route = APIUtils.createRouter('/ns');
type NameserverHosts = {
Auth: string,
API: string,
WWW: string,
Notifications: string,
Images: string,
CDN: string,
Commerce: string,
Matchmaking: string,
Storage: string,
Chat: string,
Leaderboard: string
}
const path = `${protocol}://${config.web.nameserverHost}`;
const nameserver: NameserverHosts = {
Auth: path,
API: path,
WWW: path,
Notifications: path,
Images: path,
CDN: path,
Commerce: path,
Matchmaking: path,
Storage: path,
Chat: path,
Leaderboard: path
}
route.router.get('*', (_rq, rs) => {
rs.json(nameserver);
});