mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-13 03:50:02 -04:00
Chore: format
This commit is contained in:
parent
c4d2c5b408
commit
f16ae279e2
5 changed files with 28 additions and 28 deletions
25
server.js
25
server.js
|
@ -2,11 +2,16 @@ import fs from "fs";
|
|||
import { createServer } from "node:http";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import {
|
||||
createRammerhead,
|
||||
routeRhRequest,
|
||||
routeRhUpgrade,
|
||||
shouldRouteRh
|
||||
} from "@rubynetwork/rammerhead";
|
||||
import express from "express";
|
||||
import multer from "multer";
|
||||
import { DataTypes, Sequelize } from "sequelize";
|
||||
import wisp from "wisp-server-node";
|
||||
import { createRammerhead, shouldRouteRh, routeRhUpgrade, routeRhRequest } from "@rubynetwork/rammerhead";
|
||||
import { handler as ssrHandler } from "./dist/server/entry.mjs";
|
||||
|
||||
const config = JSON.parse(fs.readFileSync("config.json", "utf8"));
|
||||
|
@ -14,10 +19,10 @@ const __filename = fileURLToPath(import.meta.url);
|
|||
const __dirname = path.dirname(__filename);
|
||||
//create the rh server.
|
||||
const rh = createRammerhead({
|
||||
logLevel: 'debug',
|
||||
reverseProxy: true,
|
||||
disableLocalStorageSync: false,
|
||||
disableHttp2: false
|
||||
logLevel: "debug",
|
||||
reverseProxy: true,
|
||||
disableLocalStorageSync: false,
|
||||
disableHttp2: false
|
||||
});
|
||||
const app = express();
|
||||
const publicPath = "dist/client";
|
||||
|
@ -322,17 +327,15 @@ server.on("request", (req, res) => {
|
|||
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
|
||||
if (shouldRouteRh(req)) {
|
||||
routeRhRequest(rh, req, res);
|
||||
}
|
||||
else {
|
||||
app(req, res);
|
||||
} else {
|
||||
app(req, res);
|
||||
}
|
||||
});
|
||||
|
||||
server.on("upgrade", (req, socket, head) => {
|
||||
if (shouldRouteRh(req)) {
|
||||
routeRhUpgrade(rh, req, socket, head);
|
||||
}
|
||||
else if (req.url.endsWith("/wisp/")) {
|
||||
routeRhUpgrade(rh, req, socket, head);
|
||||
} else if (req.url.endsWith("/wisp/")) {
|
||||
wisp.routeRequest(req, socket, head);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3,10 +3,7 @@ import Logo from "@components/Logo.astro";
|
|||
import Layout from "@layouts/Layout.astro";
|
||||
import { getLangFromUrl, useTranslations } from "../../i18n/utils";
|
||||
export function getStaticPaths() {
|
||||
const STATIC_PATHS = [
|
||||
{ params: { lang: "en_US" } },
|
||||
{ params: { lang: "jp" } },
|
||||
];
|
||||
const STATIC_PATHS = [{ params: { lang: "en_US" } }, { params: { lang: "jp" } }];
|
||||
return STATIC_PATHS;
|
||||
}
|
||||
export const prerender = true;
|
||||
|
|
|
@ -47,7 +47,7 @@ function setTransport(transport?: string) {
|
|||
case "libcurl":
|
||||
BareMux.SetTransport("CurlMod.default", {
|
||||
wisp: wispServer ? WispServerURLS[wispServer] : WispServerURLS.default
|
||||
});
|
||||
});
|
||||
break;
|
||||
}
|
||||
resolve();
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import type { Proxy } from "./settings";
|
||||
type ProxyChoices = Exclude<Proxy, "automatic">
|
||||
type ProxyChoices = Exclude<Proxy, "automatic">;
|
||||
|
||||
const SupportedSites: Record<string, ProxyChoices> = {
|
||||
"discord.gg": "uv",
|
||||
"discord.com": "uv",
|
||||
"spotify.com": "rh",
|
||||
"spotify.link": "rh",
|
||||
"youtube.com": "uv",
|
||||
"youtu.be": "uv"
|
||||
}
|
||||
"discord.gg": "uv",
|
||||
"discord.com": "uv",
|
||||
"spotify.com": "rh",
|
||||
"spotify.link": "rh",
|
||||
"youtube.com": "uv",
|
||||
"youtu.be": "uv"
|
||||
};
|
||||
|
||||
export { SupportedSites }
|
||||
export { SupportedSites };
|
||||
|
|
|
@ -3,13 +3,13 @@ export default {
|
|||
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
|
||||
theme: {
|
||||
colors: {
|
||||
"primary": "var(--background-primary)",
|
||||
"lighter": "var(--background-lighter)",
|
||||
primary: "var(--background-primary)",
|
||||
lighter: "var(--background-lighter)",
|
||||
"navbar-text-color": "var(--navbar-text-color)",
|
||||
"navbar-color": "var(--navbar-color)",
|
||||
"text-color": "var(--navbar-link-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-border-color": "var(--input-border-color)",
|
||||
"dropdown-option-hover-color": "var(--dropdown-option-hover-color)",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue