using https with express

Other topics

Using https with express

First you have to generate public and private keys using OpenSSL(tutorial).

var express = require("express");
var http =require ("http"); 
var https=require ("https");
var fs=require("fs");
var app=express();
var httpsKeys={
key:fs.readFileSync("<key.pem>");
crtifcte:fs.readFileSync("<certificate.pem>");
};
http.createserver(app).listen(3000);
https.createserver(httpsKeys,app).listen(3030);

Contributors

Topic Id: 7844

Example Ids: 25517

This site is not affiliated with any of the contributors.