1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: create config should allow all options params

This commit is contained in:
Ivar Conradi Østhus 2021-05-25 12:48:37 +02:00
parent 4e6dcaf3fd
commit 14a7d1b3b2
No known key found for this signature in database
GPG Key ID: 31AC596886B0BD09

View File

@ -223,6 +223,12 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig {
listen = { host: server.host || undefined, port: server.port };
}
const secureHeaders =
options.secureHeaders || safeBoolean(process.env.SECURE_HEADERS, false);
const enableOAS =
options.enableOAS || safeBoolean(process.env.ENABLE_OAS, false);
return {
db,
session,
@ -235,8 +241,8 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig {
import: importSetting,
experimental: experimental || {},
email,
secureHeaders: safeBoolean(process.env.SECURE_HEADERS, false),
enableOAS: safeBoolean(process.env.ENABLE_OAS, false),
secureHeaders,
enableOAS,
preHook: options.preHook,
preRouterHook: options.preRouterHook,
eventHook: options.eventHook,