clean up code
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user