chore: skip secure headers in non-production envrionments
This commit is contained in:
parent
a0c959a375
commit
726bd5d06f
2 changed files with 7 additions and 3 deletions
|
|
@ -37,12 +37,16 @@ export const scalarDescriptor = Scalar({
|
||||||
});
|
});
|
||||||
|
|
||||||
export const createApp = () => {
|
export const createApp = () => {
|
||||||
const app = new Hono().use(secureHeaders());
|
const app = new Hono();
|
||||||
|
|
||||||
if (config.trustedOrigins) {
|
if (config.trustedOrigins) {
|
||||||
app.use(cors({ origin: config.trustedOrigins }));
|
app.use(cors({ origin: config.trustedOrigins }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.environment === "production") {
|
||||||
|
app.use(secureHeaders());
|
||||||
|
}
|
||||||
|
|
||||||
if (config.environment !== "test") {
|
if (config.environment !== "test") {
|
||||||
app.use(honoLogger());
|
app.use(honoLogger());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export default defineConfig({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
host: '0.0.0.0',
|
host: "0.0.0.0",
|
||||||
port: 4096,
|
port: 3000,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue