From 351bcdddcc0566fd9186e4230403c7c31eec45c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fr=C3=A9not?= Date: Fri, 9 Nov 2012 11:00:47 +0100 Subject: [PATCH] Migration from Express 2.5 to Express 3.0 Express.createServer(); is deprecated migrated to var App = Express(); App.address() not available anymore. --- app.js | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index a35f4a9..b3c5ac7 100644 --- a/app.js +++ b/app.js @@ -3,7 +3,8 @@ var Routes = require('./routes'); // var TryCatch = require('./trycatch'); -var App = module.exports = Express.createServer(); +//var App = module.exports = Express.createServer(); +var App = Express(); // Configuration @@ -34,5 +35,5 @@ App.get('/:name', Routes.view); App.get('/:name/edit', Routes.edit); App.post('/:name', Routes.save); -App.listen(process.env.PORT || 3000); -console.log("Express server listening on port %d in %s mode", App.address().port, App.settings.env); +server = App.listen(process.env.PORT || 3000); +console.log("Express server listening on port %d in %s mode", server.address().port, App.settings.env); diff --git a/package.json b/package.json index bbe988c..2f523e4 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "express": "2.5.5", + "express": "3.0.2", "jade": ">= 0.0.1", "markdown": "~0.3.1", "trycatch": "~0.0.9"