From 0eaffaf9f7dca5b8c867e567b352819b0fb618e8 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Wed, 9 Aug 2023 10:15:21 -0400 Subject: [PATCH] directory --- src/main.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main.ts b/src/main.ts index 9363eb7..bfcea7b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,17 +18,14 @@ async function bootstrap() { let options = {}; const secure = process.env.API_SECURE?.toLowerCase() == 'true'; if (secure) { - - + const currentDirectory = process.cwd(); options = { https: { - key: readFileSync('./secrets/key.pem'), - cert: readFileSync('./secrets/cert.pem'), + key: readFileSync(`${currentDirectory}/secrets/key.pem`), + cert: readFileSync(`${currentDirectory}/secrets/cert.pem`), } }; - } else { - } const app = await NestFactory.create(AppModule, new FastifyAdapter(options)); @@ -48,8 +45,8 @@ async function bootstrap() { //Taproot bitcoinjs.initEccLib(ecc); - await app.listen(process.env.PORT, '0.0.0.0', () => { - console.log(`${secure ? 'https' : 'http'} listening on port ${process.env.PORT}`); + await app.listen(process.env.PORT, '0.0.0.0', (err, address) => { + console.log(`API listening on ${address}`); }); }