From ad652cae736d3f49c2424485d43a77dc64c31efa Mon Sep 17 00:00:00 2001 From: Merlyn Albery-Speyer Date: Thu, 24 Jan 2013 21:27:57 -0800 Subject: [PATCH] Added "express --paas heroku" option which adds package.json entries for heroku deployment to work out-of-the-box --- bin/express | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/express b/bin/express index 3c0090c6a0..d6830fff06 100755 --- a/bin/express +++ b/bin/express @@ -21,6 +21,7 @@ program .option('-J, --jshtml', 'add jshtml engine support (defaults to jade)') .option('-H, --hogan', 'add hogan.js engine support') .option('-c, --css ', 'add stylesheet support (less|stylus) (defaults to plain css)') + .option('-p, --paas [platform]', 'add support (heroku) (defaults to generic support)') .option('-f, --force', 'force on non-empty directory') .parse(process.argv); @@ -39,6 +40,8 @@ if (program.ejs) program.template = 'ejs'; if (program.jshtml) program.template = 'jshtml'; if (program.hogan) program.template = 'hjs'; +if (program.heroku) program.paas = 'heroku'; + /** * Routes index template. */ @@ -364,6 +367,13 @@ function createApplicationAt(path) { } } + if (program.paas == 'heroku') { + pkg.engines = { + node: '0.8.x' + , npm: '1.1.x' + } + } + write(path + '/package.json', JSON.stringify(pkg, null, 2)); write(path + '/app.js', app); });