Categories
JavaScript Answers

How to run npm http-server with SSL?

Spread the love

To run npm http-server with SSL, we create a certificate and use that to run the server.

To do this, we run

brew install mkcert
brew install nss

to install mkcert

Then we go to our project directory and run

mkcert 0.0.0.0 localhost 127.0.0.1 ::1

to create a certificate.

Then we run the server with our certificate with

http-server -S -C cert.pem -o

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *