Auto-generating an Express app
The process of creating the manifest file, the app.js
file, the views, and other directories and files can become a tedious chore as we start to work on multiple projects. To automate this process, we can use the express
command-line tool.
To refresh you memory, we first encountered the express
command-line tool while learning how to install Express. We were told that it generates Express app skeletons; now we have a fairly good idea what it might do.
Using its help option (-h
), let's ask express how it works and what its options are:
$ express –h Usage: express [options] [directory] Options: -h, --help output usage information -V, --version output the version number -s, --sessions add session support -e, --ejs add ejs engine support (defaults to jade) -J, --jshtml add jshtml engine support (defaults to jade) -H, --hogan add hogan.js engine support -c, --css <engine> add stylesheet...