Merge pull request #455 from xgenos/fix-issue-332

fixed the issue#332 with more optimized ORIGIN env calls
This commit is contained in:
Raj Nandan Sharma
2025-07-11 10:10:07 +05:30
committed by GitHub
2 changed files with 6 additions and 0 deletions

View File

@@ -15,6 +15,10 @@ const base = process.env.KENER_BASE_PATH || "";
const app = express();
const db = knex(knexOb);
if (process.env.ORIGIN) {
process.env.SVELTEKIT_ORIGIN = process.env.ORIGIN;
}
app.use((req, res, next) => {
if (req.path.startsWith("/embed")) {
res.setHeader("Content-Security-Policy", "frame-ancestors *");

View File

@@ -10,6 +10,7 @@ const PORT = Number(process.env.PORT) || 3000;
const base = process.env.KENER_BASE_PATH || "";
const VITE_BUILD_ENV = process.env.VITE_BUILD_ENV || "development"; // Default to "development"
const isProduction = VITE_BUILD_ENV === "production";
const ORIGIN = process.env.ORIGIN || `http://localhost:${PORT}`;
export default defineConfig(({ mode }) => ({
optimizeDeps: {
@@ -49,6 +50,7 @@ export default defineConfig(({ mode }) => ({
version(),
],
server: {
allowedHosts: [new URL(ORIGIN).hostname],
port: PORT,
watch: {
ignored: ["**/src/lib/server/data/**"], // Adjust the path to the file you want to ignore