I have an app in Angular v4 which have to change the scss dependong of the url of access. For example: if link in the browser is "example.com" then the app have background-color: black if the link is"example2.com" then the background-color: red
I have the next problem:
when I go to the hosts in C:\Windows\System32\drivers\etc and I set the next configuration in hosts 127.0.0.1 example.com 127.0.0.1 example2.com
then I run the app with "example.com:4200" the app doesn't run... the browser show me this message
"invalid host header"
How do I fix this problem?
This appeared for me under angular 7.2.1
Assuming you're using the Angular CLI, the solution was to add the following line in angular.json under architect>serve>options:
"disableHostCheck": true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With