🐛 Fixes API development

This commit is contained in:
2026-06-12 13:45:24 +02:00
parent bcb51d5397
commit 5a0a2de0f0
4 changed files with 145 additions and 6 deletions
+14
View File
@@ -17,7 +17,21 @@ const target = mode !== "dist" // OR "src"
appIndex: pathDist("index.html"),
};
import proxy from "koa-proxies";
import { users } from "./.env.js";
const middleware = [
proxy("/rest", {
target: "https://rss.jaandrle.cz",
headers: {
Authorization: "Basic " + Buffer.from(users[0]).toString("base64"),
},
logs: true,
changeOrigin: true,
}),
];
export default /** @type {import("@web/dev-server").DevServerConfig} */ ({
middleware,
open: "/", // SPA routing
nodeResolve: { // Resolve bare module imports
exportConditions: ["browser", "development"],