前言
記入一些基本的配置。
Setup IP Address、SSL、Self-signed Certificate
如果你對 IP Address、SSL、Self-signed Certification 不熟悉,請看這篇先 Vs Code, Visual Studio 2022, Angular and Live Server Running Through Https and IP Address
在 angular.json 添加設置
"options": { "host": "192.168.1.152", "port": 4200, "ssl": true, "sslKey": "C:\\self-signed-certificate\\192.168.1.152.key", "sslCert": "C:\\self-signed-certificate\\192.168.1.152.crt" },
或者在啓動 command 加上 parameters
ng serve --open --host=192.168.1.152 --port=4200 --ssl --ssl-key=C:\\self-signed-certificate\\192.168.1.152.key --ssl-cert=C:\\self-signed-certificate\\192.168.1.152.crt