
Set up HTTPS on localhost for macOS
参考: https://www.storyblok.com/faq/setup-dev-server-https-proxy
安装 mkcert 以创建有效证书并使用 mkcert 安装 localhost: 打开终端并连续运行以下命令;确保您首先安装了自制程序。
brew install mkcert
mkcert -install
mkcert localhost // 会在本地项目生成2个文件
安装 HTTPS 代理并使用以下命令运行代理: 您需要安装 Node 和 NPM 才能完成此工作。
npm install -g local-ssl-proxy // Installing the proxy
local-ssl-proxy --source 3010 --target 3000 --cert localhost.pem --key localhost-key.pem // Running the proxy to target port 3000, you can change that any port of your choice but it should be what your app is running on in development.
HTTPS 现在在端口 3010 上运行,并将请求转发到 http 3000。