diff --git a/src/main.ts b/src/main.ts index 2640d67..6df8bf4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,14 +4,15 @@ import { ExpressAdapter } from "@nestjs/platform-express"; import { AppModule } from "./app.module"; import { APPLICATION } from "./config/system.config"; import * as express from "express"; -import * as http from "http"; +import * as fs from "node:fs"; +import * as https from "node:https"; async function bootstrap() { - // const httpsOptions = { - // key: fs.readFileSync("./secrets/private-key.pem"), - // cert: fs.readFileSync("./secrets/public-certificate.pem") - // }; + const httpsOptions = { + key: fs.readFileSync("./secrets/private-key.pem"), + cert: fs.readFileSync("./secrets/public-certificate.pem") + }; const server = express(); const app = await NestFactory.create( @@ -39,8 +40,7 @@ async function bootstrap() { app.enableCors(); await app.init(); - http.createServer(server).listen(APPLICATION.HTTP_PORT); - // https.createServer(httpsOptions, server).listen(APPLICATION.HTTPS_PORT); + https.createServer(httpsOptions, server).listen(APPLICATION.HTTPS_PORT); }