LoginSignup
2
2

More than 5 years have passed since last update.

MEANスタックのNとE

Last updated at Posted at 2015-12-28

MEANスタックのNとE、Node.jsとExpressの構築をやっていきましょう。

Node.jsとExpressのインストール

Node.jsをインストールして、この辺りを参考に0.12.xxにバージョンアップしました。
http://akiyoko.hatenablog.jp/entry/2015/06/20/132239

Expressはnpmで以下のコマンドを実行してインストールします。

npm install -g express
npm install -g express-generator

express-generatorは、アプリケーションの自動生成のライブラリですね。

リポジトリの作成

Github上でリポジトリを作成します。

Screen Shot 2015-12-28 at 15.06.51.png

今回のプロジェクト名は siamese です。
今回は.gitignoreにはNodeを、licenseにはMITを指定しました。

作成したリポジトリをローカルにcloneして準備完了。

先ほどcloneしたプロジェクトの 1階層上で 、以下のコマンドを実行します。

$ express -e siamese
destination is not empty, continue? [y/N] y

Expressプロジェクトに必要なファイルやディレクトリが自動で作成されました。

あとは以下のようにリポジトリの直下に移動して、npmで必要なパッケージをインストールすれば雛形の完成です。

$ cd siamese && npm install

では、早速起動してみましょう。以下のコマンドで起動して、 http://localhost:3000 にアクセスします。

$ npm start
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