diff --git a/src/index.ts b/src/index.ts index bbdbc20..239e333 100644 --- a/src/index.ts +++ b/src/index.ts @@ -51,7 +51,7 @@ async function combinePath(path: string, tryAgain = true): Promise { } else { if (!path.includes(".")) { const str = await combinePath(path + ".html", false); - if (str !== __dirname + "/webpage/index.html") { + if (str !== __dirname + "/webpage/app.html") { return str; } } @@ -59,7 +59,7 @@ async function combinePath(path: string, tryAgain = true): Promise { dirs = await getDirectories(__dirname); return combinePath(path, false); } - return __dirname + "/webpage/index.html"; + return __dirname + "/webpage/app.html"; } } interface Instance { @@ -180,6 +180,10 @@ app.use("/", async (req: Request, res: Response) => { res.sendFile(path.join(__dirname, "webpage", "template.html")); return; } + if (req.path === "index.html") { + res.sendFile(path.join(__dirname, "webpage", "app.html")); + return; + } const filePath = await combinePath("/webpage/" + req.path); res.sendFile(filePath); }); diff --git a/src/webpage/index.html b/src/webpage/index.html deleted file mode 100644 index 3afb6a5..0000000 --- a/src/webpage/index.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - Jank Client - - - - - - - - - - - -
-
- -

Jank Client is loading

-

This shouldn't take long

-

Switch Accounts

-
-
-
-
-
-
-

Server Name

-
-
-
-
- -
-
-
- - -
-

USERNAME

-

STATUS

-
-
- -
-
-
-
-
-
-
-
-
- - - - Channel name - - -
-
- -
-
- - -
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
- - - -
-
- -
-
-
-
-
-
-
-
-
- - - - diff --git a/src/webpage/service.ts b/src/webpage/service.ts index 388388f..0eb1f21 100644 --- a/src/webpage/service.ts +++ b/src/webpage/service.ts @@ -56,7 +56,7 @@ function samedomain(url: string | URL) { let enabled = "false"; let offline = false; -const htmlFiles = new Set(["/index", "/login", "/home", "/register", "/oauth2/auth", "/reset"]); +const htmlFiles = new Set(["/app", "/login", "/home", "/register", "/oauth2/auth", "/reset"]); function isHtml(url: string): string | void { const path = new URL(url).pathname; if (htmlFiles.has(path) || htmlFiles.has(path + ".html")) { @@ -69,7 +69,7 @@ function toPath(url: string): string { if (!html) { const path = Url.pathname; if (path.startsWith("/channels")) { - html = "./index.html"; + html = "./app.html"; } else if (path.startsWith("/invite/") || path === "/invite") { html = "./invite.html"; } else if (path.startsWith("/template/") || path === "/template") {