我想通过 SSL 为我的应用程序提供服务,之前我有这个脚本:
ng serve --ssl --ssl-key "pathtokey\key.crt"
我想在新的 angular.json 中添加 SSL,但是当我尝试添加它时出现错误:
Schema validation failed with the following errors:
Data path "" should NOT have additional properties(ssl).
在 angular cli 6 中使用 SSL 的正确方法是什么?
最佳答案
在 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,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49881328/