LoginSignup
7
5

More than 5 years have passed since last update.

angular4 ng serve 4200ポートへの外部からのアクセス方法

Last updated at Posted at 2018-02-07

問題

  • ng serve で起動したURLに外部端末からだとアクセスできない。 http://localhost:4200 は当然としても、 http://192.168.11.1:4200 みたいなアクセスも出来ない。

解決

  • angular-cli.jsonを以下のように書き換える
  "defaults": {
    "styleExt": "scss",
    "build": {
      "showCircularDependencies": false
    },
    "serve": {
      "port": 4200,
      "host": "192.168.11.1"
    },
    "component": {}
  }
  • ng serve して外部端末から http://192.168.11.1:4200 でアクセスできるようになる

参考にしたもの

感想

  • 参考にしたやつと全く同じで行けた。知識足らず。。。。。
7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5