Angular 17+ 高級教程 – Angular Configuration (angular.json)

前言

記入一些基本的配置。

 

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"
},
View Code

或者在啓動 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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章