Skip to content

Commit cd89717

Browse files
committed
Refactor HTTPS options handling to use spread operator for improved configuration
1 parent 5055741 commit cd89717

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ declare const module: any;
1919
});
2020
await logger.initialize();
2121

22-
let httpsOptions = {};
22+
console.log('cfg', cfg.application);
23+
24+
let extraOptions = <any>{};
2325
if (cfg.application?.https?.enabled) {
2426
try {
25-
httpsOptions = {
27+
extraOptions.httpsOptions = {
2628
key: readFileSync(cfg.application?.https?.key),
2729
cert: readFileSync(cfg.application?.https?.cert),
2830
};
@@ -37,7 +39,7 @@ declare const module: any;
3739
rawBody: true,
3840
cors: true,
3941
logger,
40-
httpsOptions,
42+
...extraOptions,
4143
});
4244
app.use((_: any, res: Response, next: () => void) => {
4345
res.removeHeader('x-powered-by');

0 commit comments

Comments
 (0)