Angular 6 angular.json在配置中添加SSL [英] Angular 6 angular.json add ssl in configuration

查看:305
本文介绍了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,但是当我尝试添加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).

将SSL与angular cli 6一起使用的正确方法是什么?

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆