You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quick tutorial how to serve current working directory over https, using self-signed cert, on Windows, from Git Bash, with NodeJS
npm install -g http-server
// follow this first if you use OpenSSL from Git Bash
https://gist.github.com/jakub-g/23699ec40cc23e5b8adfd8c9261487d6
// go to the folder that is to be served
cd /some/dir
// generate the cert. Keep pressing ENTER to use the defaults
openssl req -config /c/Program\ Files\ \(x86\)/Git/ssl/openssl.cnf -nodes -new -x509 -keyout key.pem -out cert.pem
// now optionally, gitignore the private and public cert files, so that they are not accidentally checked in to git
// I prefer to gitignore them globally
git config --global core.excludesfile ~/.gitignore_global
echo "key.pem" >> ~/.gitignore_global
echo "cert.pem" >> ~/.gitignore_global
// start the server with SSL enabled, on port 443
http-server --ssl -p 443
// or if you want to go fancy and have both http and https
http-server --ssl -p 443 & http-server -p 80 &