directory

This commit is contained in:
Ben Wilson 2023-08-09 10:15:21 -04:00
parent 76319d9625
commit 0eaffaf9f7

View File

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