20
18

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 5 years have passed since last update.

node.jsでお手軽にサーバーを立てるlibrary serve。

Last updated at Posted at 2013-05-21

開発中にサーバーを立てる必要が出てきます。
その際におすすめするのがnode.jsのserveコマンドです。

serve

npmでglobalにserveをいれます。


$ npm install -g serve

/devで開発しているとします。目的のdirectoryでserveと入力します。
デフォルトでは3000番ポートが開きます。

$ cd /dev
$ serve
serving /dev on port 3000
# または
$ serve /dev

-pオプションで任意のポートで実行出来ます。


$ serve -p 4000

ファイル名に日本語があるとうまくいかないことことがあります。

20
18
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
20
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?