Skip to content

Instantly share code, notes, and snippets.

@jeffschwartz
Created May 26, 2013 22:23
Show Gist options
  • Save jeffschwartz/5654233 to your computer and use it in GitHub Desktop.
Save jeffschwartz/5654233 to your computer and use it in GitHub Desktop.
My started package.json for a typical ExpressJS/ejs Node aApp
{
"name": "application-name",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "~3.2.5",
"ejs": "~0.8.4",
"less-middleware": "*",
"express-ejs-layouts": "~0.3.1"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-less": "~0.5.2",
"grunt-contrib-watch": "~0.4.3"
}
}
@jeffschwartz
Copy link
Author

Add the following to your app.js file:

expressLayouts = require('express-ejs-layouts')

app.set( 'view engine', 'ejs' );

app.set('layout', 'layout'); // defaults to 'layout'

app.use(expressLayouts);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment