(hopefully) actually fix rh

This commit is contained in:
wearrrrr 2024-02-22 12:07:53 -06:00
parent 75d0e73836
commit 34fdf7c5ce
2 changed files with 6 additions and 6 deletions

View file

@ -17,8 +17,6 @@ const PORT = process.env.PORT || 3000;
const bare = createBareServer("/bare/"); const bare = createBareServer("/bare/");
console.log(chalk.gray("Starting Bare...")); console.log(chalk.gray("Starting Bare..."));
const rh = createRammerhead();
console.log(chalk.gray("Starting Rammerhead...")); console.log(chalk.gray("Starting Rammerhead..."));
const rammerheadScopes = [ const rammerheadScopes = [
@ -35,15 +33,17 @@ const rammerheadScopes = [
"/editsession", "/editsession",
"/needpassword", "/needpassword",
"/syncLocalStorage", "/syncLocalStorage",
"/api/shuffleDict", "/api/shuffleDict"
"/mainport",
]; ];
const rammerheadSession = /^\/[a-z0-9]{32}/; const rammerheadSession = /^\/[a-z0-9]{32}/;
function shouldRouteRh(req) { function shouldRouteRh(req) {
const url = new URL(req.url, "http://0.0.0.0"); const url = new URL(req.url, "http://0.0.0.0");
return rammerheadScopes.includes(url.pathname) || rammerheadSession.test(url.pathname); return (
rammerheadScopes.includes(url.pathname) ||
rammerheadSession.test(url.pathname)
);
} }
function routeRhRequest(req, res) { function routeRhRequest(req, res) {

View file

@ -1,6 +1,6 @@
{ {
"extends": "astro/tsconfigs/strict", "extends": "astro/tsconfigs/strict",
"exclude": ["node_modules/**", "dist/**"], "exclude": ["node_modules/**/*", "dist/**"],
"compilerOptions": { "compilerOptions": {
"verbatimModuleSyntax": false "verbatimModuleSyntax": false
} }