Last active
December 17, 2015 06:49
-
-
Save kwmt/5568311 to your computer and use it in GitHub Desktop.
node.jsをインストールし、使えることを確認した後、ウェブアプリケーションフレームワークであるexpressをインストールして動かしてみるところまで。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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