14
15

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.

ExpressでWebアプリケーションを自動生成する

Posted at

前提

npm インストール済

express, express-generator, ejsをグローバルインストールする

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

インストールフォルダを作る

mkdir -p /Desktop/06.express-generator

コマンドでWebアプリケーションを自動生成する

自動生成コマンドを実行する

cd /Desktop
express -e 06.express-generator   #ejsテンプレートをオプションで指定

結果

   create : 06.express-generator
   create : 06.express-generator/package.json
   create : 06.express-generator/app.js
   create : 06.express-generator/public
   create : 06.express-generator/public/javascripts
   create : 06.express-generator/routes
   create : 06.express-generator/routes/index.js
   create : 06.express-generator/routes/users.js
   create : 06.express-generator/public/stylesheets
   create : 06.express-generator/public/stylesheets/style.css
   create : 06.express-generator/views
   create : 06.express-generator/views/index.ejs
   create : 06.express-generator/views/error.ejs
   create : 06.express-generator/public/images
   create : 06.express-generator/bin
   create : 06.express-generator/bin/www

   install dependencies:
     $ cd 06.express-generator && npm install

   run the app:
     $ DEBUG=06.express-generator ./bin/www

依存モジュールインストール

cd 06.express-generator && npm install

アプリ実行する

   DEBUG=06.express-generator ./bin/www          

アプリを確認する

14
15
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
14
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?