ngATL Conference Atlanta, GA

NestJS on 2018 ngATL Conference Atlanta, GA

NestJS 2018 ngATL

LEARN MORE

HTTPS & Multiple Simultaneous Servers

Since you can have a full control of the express instance lifecycle, it's not a big deal to create a few multiple simultaneous servers (e.g. both HTTP & HTTPS).

TypeScript

const httpsOptions = {
  key: fs.readFileSync("./secrets/private-key.pem"),
  cert: fs.readFileSync("./secrets/public-certificate.pem")
};

const server = express();
const app = await NestFactory.create(ApplicationModule, server);
await app.init();

http.createServer(server).listen(3000);
https.createServer(httpsOptions, server).listen(443);

Sponsors

Nest is an MIT-licensed open source project. It can grow thanks to the support by these awesome people. If you'd like to join them, please read more here. Thanks!

Become a sponsor