Skip to content

Commit

Permalink
fix https issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sahalali committed Oct 4, 2024
1 parent ae7f87f commit 7e426db
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);

}

Expand Down

0 comments on commit 7e426db

Please sign in to comment.