2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

node.js + Expressサーバーのポートを変更する

Last updated at Posted at 2021-07-30

初期設定ではlocalhost:3000となっているが、 bin/wwwファイルを変更することでポートを変更できる。

この点を

``` var port = normalizePort(process.env.PORT || '3000'); ```

このように

``` var port = normalizePort(process.env.PORT || '4000'); ```

これでローカルでwebサーバーを立ち上げる際にポートを分けることができる。

参考

stackoverflow
2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?