Get angular-cli to ng serve over HTTPS

后端 未结 9 1460
一整个雨季
一整个雨季 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

    You are correct. The current implementation does not take the ssl configuration options under account. I have created a pull request that fixes this issue. However it has not been merged yet in the master at the time of this writing.

    0 讨论(0)
  • 2020-11-28 03:46

    Angular CLI 1.0.0+.

    ng serve --ssl 1 --ssl-key {{key-path}} --ssl-cert {{cert-path}}

    Angular CLI 6+

    ng serve --ssl true --sslKey {{key-path}} --sslCert {{cert-path}}

    Change the values ​​in {{*-path}}, to the corresponding values.

    0 讨论(0)
  • 2020-11-28 03:50

    Very simple solution from this page

    npm install browser-sync --save-dev

    ng serve --ssl true --ssl-key /node_modules/browser-sync/lib/server/certs/server.key --ssl-cert /node_modules/browser-sync/lib/server/certs/server.crt

    Quick and bold) Just used it in my angular cli 6.2.3 project

    0 讨论(0)
提交回复
热议问题