Chore: format

This commit is contained in:
MotorTruck1221 2024-10-09 02:39:44 -06:00
parent c4d2c5b408
commit f16ae279e2
No known key found for this signature in database
GPG key ID: 08F417E2B8B61EA4
5 changed files with 28 additions and 28 deletions

View file

@ -2,11 +2,16 @@ import fs from "fs";
import { createServer } from "node:http"; import { createServer } from "node:http";
import path from "path"; import path from "path";
import { fileURLToPath } from "url"; import { fileURLToPath } from "url";
import {
createRammerhead,
routeRhRequest,
routeRhUpgrade,
shouldRouteRh
} from "@rubynetwork/rammerhead";
import express from "express"; import express from "express";
import multer from "multer"; import multer from "multer";
import { DataTypes, Sequelize } from "sequelize"; import { DataTypes, Sequelize } from "sequelize";
import wisp from "wisp-server-node"; import wisp from "wisp-server-node";
import { createRammerhead, shouldRouteRh, routeRhUpgrade, routeRhRequest } from "@rubynetwork/rammerhead";
import { handler as ssrHandler } from "./dist/server/entry.mjs"; import { handler as ssrHandler } from "./dist/server/entry.mjs";
const config = JSON.parse(fs.readFileSync("config.json", "utf8")); const config = JSON.parse(fs.readFileSync("config.json", "utf8"));
@ -14,7 +19,7 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename); const __dirname = path.dirname(__filename);
//create the rh server. //create the rh server.
const rh = createRammerhead({ const rh = createRammerhead({
logLevel: 'debug', logLevel: "debug",
reverseProxy: true, reverseProxy: true,
disableLocalStorageSync: false, disableLocalStorageSync: false,
disableHttp2: false disableHttp2: false
@ -322,8 +327,7 @@ server.on("request", (req, res) => {
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp"); res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
if (shouldRouteRh(req)) { if (shouldRouteRh(req)) {
routeRhRequest(rh, req, res); routeRhRequest(rh, req, res);
} } else {
else {
app(req, res); app(req, res);
} }
}); });
@ -331,8 +335,7 @@ server.on("request", (req, res) => {
server.on("upgrade", (req, socket, head) => { server.on("upgrade", (req, socket, head) => {
if (shouldRouteRh(req)) { if (shouldRouteRh(req)) {
routeRhUpgrade(rh, req, socket, head); routeRhUpgrade(rh, req, socket, head);
} } else if (req.url.endsWith("/wisp/")) {
else if (req.url.endsWith("/wisp/")) {
wisp.routeRequest(req, socket, head); wisp.routeRequest(req, socket, head);
} }
}); });

View file

@ -3,10 +3,7 @@ import Logo from "@components/Logo.astro";
import Layout from "@layouts/Layout.astro"; import Layout from "@layouts/Layout.astro";
import { getLangFromUrl, useTranslations } from "../../i18n/utils"; import { getLangFromUrl, useTranslations } from "../../i18n/utils";
export function getStaticPaths() { export function getStaticPaths() {
const STATIC_PATHS = [ const STATIC_PATHS = [{ params: { lang: "en_US" } }, { params: { lang: "jp" } }];
{ params: { lang: "en_US" } },
{ params: { lang: "jp" } },
];
return STATIC_PATHS; return STATIC_PATHS;
} }
export const prerender = true; export const prerender = true;

View file

@ -1,5 +1,5 @@
import type { Proxy } from "./settings"; import type { Proxy } from "./settings";
type ProxyChoices = Exclude<Proxy, "automatic"> type ProxyChoices = Exclude<Proxy, "automatic">;
const SupportedSites: Record<string, ProxyChoices> = { const SupportedSites: Record<string, ProxyChoices> = {
"discord.gg": "uv", "discord.gg": "uv",
@ -8,6 +8,6 @@ const SupportedSites: Record<string, ProxyChoices> = {
"spotify.link": "rh", "spotify.link": "rh",
"youtube.com": "uv", "youtube.com": "uv",
"youtu.be": "uv" "youtu.be": "uv"
} };
export { SupportedSites } export { SupportedSites };

View file

@ -3,13 +3,13 @@ export default {
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"], content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
theme: { theme: {
colors: { colors: {
"primary": "var(--background-primary)", primary: "var(--background-primary)",
"lighter": "var(--background-lighter)", lighter: "var(--background-lighter)",
"navbar-text-color": "var(--navbar-text-color)", "navbar-text-color": "var(--navbar-text-color)",
"navbar-color": "var(--navbar-color)", "navbar-color": "var(--navbar-color)",
"text-color": "var(--navbar-link-color)", "text-color": "var(--navbar-link-color)",
"text-hover-color": "var(--navbar-link-hover-color)", "text-hover-color": "var(--navbar-link-hover-color)",
"input": "var(--input-background-color)", input: "var(--input-background-color)",
"input-text": "var(--input-text-color)", "input-text": "var(--input-text-color)",
"input-border-color": "var(--input-border-color)", "input-border-color": "var(--input-border-color)",
"dropdown-option-hover-color": "var(--dropdown-option-hover-color)", "dropdown-option-hover-color": "var(--dropdown-option-hover-color)",