Get angular-cli to ng serve over HTTPS

后端 未结 9 1518
一整个雨季
一整个雨季 2020-11-28 02:59

The following doesn\'t seem to do anything.

ng serve --ssl true --ssl-key  --ssl-cert 

Creating the

9条回答
  •  广开言路
    2020-11-28 03:44

    JFYI, in Angular6 you have to put the conf in the options (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"
        },
        ...
    }
    

提交回复
热议问题