Express by Examples

Installation with Hogan

If we don't want Jade template engine we can use Hogan .

 

$express myproject --hogan -c less

 

--hogan       -tels to install Hogane template engine

-c less | stylus              -installs CSS compiler that can be less or stylus

 

 

Also we can use shorter:

$express myproject -H -c less

 

If we dont want to create folder myproject use:

$express . -H -c less

 

 

package.json

 {
  "name": "myproject",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "node ./bin/www"
  },
  "dependencies": {
    "body-parser": "~1.10.2",
    "cookie-parser": "~1.3.3",
    "debug": "~2.1.1",
    "express": "~4.11.1",
    "hjs": "~0.0.6",
    "less-middleware": "1.0.x",
    "morgan": "~1.5.1",
    "serve-favicon": "~2.2.0"
  }
}

 

 

You can see that there is no /node_modules/ directory inside /myproject/ dir.

So let's install dependencies:

$cd myproject

$npm install