Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kwmt/5568311 to your computer and use it in GitHub Desktop.
Save kwmt/5568311 to your computer and use it in GitHub Desktop.
node.jsをインストールし、使えることを確認した後、ウェブアプリケーションフレームワークであるexpressをインストールして動かしてみるところまで。
1.Node.jsをダウンロード
http://nodejs.org/download/
http://nodejs.org/dist/v0.10.5/node-v0.10.5-darwin-x64.tar.gz
2.解凍
$ tar xvzf node-v0.10.5-darwin-x64.tar.gz
$ cd node-v0.10.5-darwin-x64/bin
3.コマンドが使えることを確認して
$ ./node --version
v0.10.5
4.Hello Worldを実施
$ ./node
>
hello
undefined
>
5. .tcshrcにPATHを追加
setenv PATH $HOME/nodejs/node-v0.10.5-darwin-x64/bin:$PATH
※この時rehashが必要
6.ウェブアプリケーションフレームワークexpressをインストール
$ npm install -g express
$ express handson
$ cd handson/
$ npm install
7.expressのデフォルトのapp.jsを起動
$ node app.js
Express server listening on port 3000
8.ブラウザ確認
http://localhost:3000/
を叩き、下記がでれば成功!
--
Express
Welcome to Express
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment