Angular 18+ 高级教程 – 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

 

posted @   兴杰  阅读(174)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 推荐几款开源且免费的 .NET MAUI 组件库
· 实操Deepseek接入个人知识库
· 易语言 —— 开山篇
· 【全网最全教程】使用最强DeepSeekR1+联网的火山引擎,没有生成长度限制,DeepSeek本体
历史上的今天:
2017-02-02 angular2 学习笔记 ( angular cli & npm version manage npm 版本管理 )
点击右上角即可分享
微信分享提示