Angular 6 angular.json 在配置中添加 ssl [英] Angular 6 angular.json add ssl in configuration
本文介绍了Angular 6 angular.json 在配置中添加 ssl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想通过 SSL 为我的应用程序提供服务,之前我有这个脚本:
I want to serve my application though SSL previously I had this script:
ng serve --ssl --ssl-key "pathtokey\key.crt"
我想在新的 angular.json 中添加 SSL,但是当我尝试添加它时出现错误:
I want to add SSL in the new angular.json but when i try to add it i got the error:
Schema validation failed with the following errors:
Data path "" should NOT have additional properties(ssl).
在 angular cli 6 中使用 SSL 的正确方法是什么?
What is the proper way to use SSL with angular cli 6?
推荐答案
在 angular.json 中:
In angular.json:
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "app:build",
"ssl": true,
"sslKey": "path to .key",
"sslCert": "path to .crt"
},
...
}
这篇关于Angular 6 angular.json 在配置中添加 ssl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文