Skip to content

Commit

Permalink
feat: in devmode use proxy ootb
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Junk committed Nov 8, 2023
1 parent 6843b33 commit 23f4f4d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion .env

This file was deleted.

1 change: 1 addition & 0 deletions src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ declare global {
// interface Platform {}
}
declare const __APP_VERSION__: string;
declare const __PROXYURL__: string;
}

export {};
3 changes: 2 additions & 1 deletion src/lib/urlloader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { appStore } from "$lib/store";
import { convertToDocModel } from "$lib/singleview/docmodel/docmodel";
import { PUBLIC_PROXY_PATH } from "$env/static/public";
/*global __PROXYURL__*/
const PUBLIC_PROXY_PATH: string = __PROXYURL__;

/**
* loadSingleCSAF loads a single CSAF document.
Expand Down
4 changes: 3 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { fileURLToPath } from "url";
const file = fileURLToPath(new URL("package.json", import.meta.url));
const json = readFileSync(file, "utf8");
const pkg = JSON.parse(json);
const dev = process.argv.includes("dev");

export default defineConfig({
server: {
Expand All @@ -39,6 +40,7 @@ export default defineConfig({
}
},
define: {
__APP_VERSION__: `${JSON.stringify(pkg.version)}`
__APP_VERSION__: `${JSON.stringify(pkg.version)}`,
__PROXYURL__: dev ? "/proxy/" : ""
}
});

0 comments on commit 23f4f4d

Please sign in to comment.