mirror of
https://github.com/rajnandan1/kener.git
synced 2026-01-06 01:20:15 -06:00
Merge pull request #455 from xgenos/fix-issue-332
fixed the issue#332 with more optimized ORIGIN env calls
This commit is contained in:
4
main.js
4
main.js
@@ -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 *");
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user