npx live-server is an easy one liner to spin up a server, that opens a browser for you and also updates changes on safe.
Sometimes that's not enough. Often you want to pull in data from an API, and that requires HTTPS, and also you need to work around CORS limitations. Here's a simple way to do that.
First create a local certificate in
/tmpif it's not there
||Enable CORS via the Access-Control-Allow-Origin header|
||Proxy unhandled requests to
||Turn off caching|
Here's something you can stick in your path to run it.
#!/bin/bash if [ ! -f /tmp/key.pem ]; then echo Creating key openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout /tmp/key.pem -out /tmp/cert.pem -batch fi npx http-server --cors -S -P https://tezlabapp.com -c-1 -C /tmp/cert.pem -K /tmp/key.pem