0
0

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を使って簡単なアプリ作成

0
Posted at

nodeの勉強のために、expressを使ってアプリ作成part2

https://expressjs.com/ja/starter/generator.html
を追うだけの簡単なお仕事

インストール

$ npm init
$ npm install express-generator

アプリ立ち上げ

テンプレートエンジンとスタイルシートエンジンをオプションで選択できるよう。
普段phpをよく使う身としては、twigが描きやすそう
スタイルシートは普通にcssでいいでしょう。

$ express --view=twig myapp
$ ls .
myapp
node_modules
package-lock.json
package.json

$ tree myapp
myapp
├── app.js
├── bin
│   └── www
├── package.json
├── public
│   ├── images
│   ├── javascripts
│   └── stylesheets
│       └── style.css
├── routes
│   ├── index.js
│   └── users.js
└── views
    ├── error.twig
    ├── index.twig
    └── layout.twig
$ cd myapp
$ npm install
$ DEBUG=myapp:* npm start

以下のようなページが表示されましたー。

スクリーンショット 2018-11-10 15.42.30.png
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?