Search code examples
angularjscloudangular-clicloud9codeanywhere

build angularjs 2 with angularjs-cli on codeanywhere


I am getting invalid host header problem while i am trying to server my application by ng serve --host 0.0.0.0 . I have tried the following. 1.install -g angular-cli 2. cd to that app-directory 3. change port in angular-cli.json

"defaults": {
    "styleExt": "css",
    "component": {},
    "serve": {
              "port": 1337
             }
  }
  1. ng serve --host 0.0.0.0
  2. Requested url in browser is http://port-1337.angular2-jobproject0889272.codeanyapp.com/

    screen shot of container and browser


Solution

  • I was looking to sovle a different problem and came across an answer that may work for you.

    ng serve --port 8080 --host 0.0.0.0 --disableHostCheck true
    

    Angular-cli GitHub