clean up code

This commit is contained in:
2026-02-06 23:18:13 +01:00
parent 3cac486f6f
commit 11c3f141d5
31 changed files with 677 additions and 1915 deletions

View File

@@ -1,7 +1,6 @@
import react from "@vitejs/plugin-react";
import { defineConfig, loadEnv } from "vite";
import { handleSteamRefresh, handleConfigLoad } from "./server/steam-api.mjs";
import { handleGameAsset } from "./server/assets-api.mjs";
import { handleSteamRefresh } from "./server/steam-api.mjs";
const apiMiddlewarePlugin = {
name: "api-middleware",
@@ -11,12 +10,6 @@ const apiMiddlewarePlugin = {
if (url.startsWith("/api/steam/refresh")) {
return handleSteamRefresh(req, res);
}
if (url.startsWith("/api/config/load")) {
return handleConfigLoad(req, res);
}
if (url.startsWith("/api/games/")) {
return handleGameAsset(req, res);
}
next();
});
},
@@ -26,9 +19,7 @@ export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
return {
// GitHub Pages: /whattoplay/
// Uberspace: /
base: env.VITE_BASE_PATH || "/whattoplay/",
base: env.VITE_BASE_PATH || "/",
plugins: [react(), apiMiddlewarePlugin],
server: {
port: 5173,