chore: skip secure headers in non-production envrionments

This commit is contained in:
Nicolas Meienberger 2026-01-28 22:15:11 +01:00
parent a0c959a375
commit 726bd5d06f
2 changed files with 7 additions and 3 deletions

View file

@ -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());
} }

View file

@ -14,7 +14,7 @@ export default defineConfig({
}, },
}, },
server: { server: {
host: '0.0.0.0', host: "0.0.0.0",
port: 4096, port: 3000,
}, },
}); });