3

Is there a way I can run my angular localhost over https?? I have tried a few different tutorials but nothing has worked Ive tried.. serve your angular cli app over https but it would still serve over http:// has anyone succesfully done this? If so can you point me in the right direction?

Thanks

Smokey Dawson
  • 8,827
  • 19
  • 77
  • 152
  • @PardeepJain There must be a way to run a development angular app over https – Smokey Dawson Apr 24 '18 at 06:36
  • Your best option would be to run a server with a certificate. You can check [let's encrypt](https://letsencrypt.org/) for that, and how to create a server. Then, you should be able to access your application over https. –  Apr 24 '18 at 06:40

1 Answers1

1

Another option, if you don't have a certificate and want to use a self-signed for testing purposes, just to add the flag "start": "ng serve --ssl", to the package.json, it will generate one when serving the app.

Angular CLI: 7.3.1
Node: 8.11.3
OS: win32 x64
Angular: 7.2.5

Command:

npm start

Output:

> ng serve --ssl
** Angular Live Development Server is listening on localhost:4200, 
open your browser on https://localhost:4200/ 
     10% building 4/4 modules 0 activei 「wds」: Generating SSL Certificate
abestrad
  • 898
  • 2
  • 12
  • 23