express创建项目

时间:2022-11-15 01:53:57

sudo apt-get install node-express-generator


dave@voctrals:~/WebstormProjects/nodejs-study/express$ express -h

Usage: express [options] [dir]

Options:

-h, --help output usage information
-V, --version output the version number
-e, --ejs add ejs engine support (defaults to jade)
-H, --hogan add hogan.js engine support
-c, --css <engine> add stylesheet <engine> support (less|stylus|compass) (defaults to plain css)
-f, --force force on non-empty directory


dave@voctrals:~/WebstormProjects/nodejs-study/express$ express -V
4.0.0


dave@voctrals:~/WebstormProjects/nodejs-study/express$ express -e

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

install dependencies:
$ cd . && npm install

run the app:
$ DEBUG=my-application ./bin/www