Angular 6 angular.json add ssl in configuration

空扰寡人 提交于 2020-08-23 04:03:38

问题


I want to serve my application though SSL previously I had this script:

ng serve --ssl --ssl-key "pathtokey\key.crt"

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).

What is the proper way to use SSL with angular cli 6?


回答1:


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"
    },
    ...
}


来源:https://stackoverflow.com/questions/49881328/angular-6-angular-json-add-ssl-in-configuration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!