Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a90b4b81fc
Fetching contributors…

Cannot retrieve contributors at this time

76 lines (60 sloc) 2.343 kb
h3(id='executable') Using express(1) to generate an app
Express is bundled with an executable, aptly named <code>express(1)</code>.
If you install express globally with npm you'll have it available from anywhere
on your machine:
$ npm install -g express
This tool provides a simple way to get an application skeleton going,
but has limited scope, for example it supports only a few template engines,
whereas Express itself supports virtually any template engine built for node.
Be sure to check out the <code>--help</code>:
Usage: express [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 <engine> support (less|stylus) (defaults to plain css)
-f, --force force on non-empty directory
If you want to generate an application with EJS, Stylus, and session
support you would simply execute:
$ express --sessions --css stylus --ejs myapp
create : myapp
create : myapp/package.json
create : myapp/app.js
create : myapp/public
create : myapp/public/javascripts
create : myapp/public/images
create : myapp/public/stylesheets
create : myapp/public/stylesheets/style.styl
create : myapp/routes
create : myapp/routes/index.js
create : myapp/views
create : myapp/views/index.ejs
install dependencies:
$ cd myapp && npm install
run the app:
$ node app
Like any other node application, you must then install the dependencies:
$ cd myapp
$ npm install
Then fire it up!
$ node app
That's all you need to get a simple application up and running. Keep in mind
that Express is not bound to any specific directory structure, these are simply
a baseline for you to work from. For application structure alternatives be
sure to view the <a href="">examples</a>
found in the github repo.
Jump to Line
Something went wrong with that request. Please try again.