Set-up #ssl in #nodejs and Express using OpenSSL
▻https://hackernoon.com/set-up-ssl-in-nodejs-and-express-using-openssl-f2529eab5bb?source=rss---
This a simple, easy-to-follow tutorial on how to serve pages over https in NodeJS using Express Framework.Tools/Frameworks we would be using for this tutorial, are:NodeJS: You should’ve basic knowledge on how to program in NodeJS.OpenSSL: A tool to generate key and certificate.ExpressJS (npm i express): Back-end framework for writing web servers in NodeJS. More about Express.https : Comes with NodeJS.Let’s set-up our project directory. It’s not a directory with lots of files. Instead, it contains only 4 files which are package.json, key.pem, cert.pem and server.js. So, create a new directory node-https, cd node-https and run npm init -y to create package.json file.Now install express using npm i —save express. Create a server.js file and type the following code in it.Our server.js should (...)