Skip to content

Commit c82d089

Browse files
committed
refactor: use async API
1 parent 9f10c3d commit c82d089

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/Server.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,14 @@ class Server {
427427
);
428428
}
429429

430-
fakeCert = fs.readFile(certificatePath);
430+
fakeCert = await new Promise((resolve, reject) => {
431+
fs.readFile(certificatePath, (error, data) => {
432+
if (error) {
433+
reject(error);
434+
}
435+
resolve(data);
436+
});
437+
});
431438

432439
this.logger.info(`SSL certificate: ${certificatePath}`);
433440
}

0 commit comments

Comments
 (0)