mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
directory
This commit is contained in:
+5
-8
@@ -18,17 +18,14 @@ async function bootstrap() {
|
|||||||
let options = {};
|
let options = {};
|
||||||
const secure = process.env.API_SECURE?.toLowerCase() == 'true';
|
const secure = process.env.API_SECURE?.toLowerCase() == 'true';
|
||||||
if (secure) {
|
if (secure) {
|
||||||
|
const currentDirectory = process.cwd();
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
https: {
|
https: {
|
||||||
key: readFileSync('./secrets/key.pem'),
|
key: readFileSync(`${currentDirectory}/secrets/key.pem`),
|
||||||
cert: readFileSync('./secrets/cert.pem'),
|
cert: readFileSync(`${currentDirectory}/secrets/cert.pem`),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter(options));
|
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter(options));
|
||||||
@@ -48,8 +45,8 @@ async function bootstrap() {
|
|||||||
//Taproot
|
//Taproot
|
||||||
bitcoinjs.initEccLib(ecc);
|
bitcoinjs.initEccLib(ecc);
|
||||||
|
|
||||||
await app.listen(process.env.PORT, '0.0.0.0', () => {
|
await app.listen(process.env.PORT, '0.0.0.0', (err, address) => {
|
||||||
console.log(`${secure ? 'https' : 'http'} listening on port ${process.env.PORT}`);
|
console.log(`API listening on ${address}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user