Migration from Express 2.5 to Express 3.0
Express.createServer(); is deprecated migrated to var App = Express(); App.address() not available anymore.
This commit is contained in:
parent
323878136b
commit
351bcdddcc
7
app.js
7
app.js
@ -3,7 +3,8 @@ var Routes = require('./routes');
|
|||||||
|
|
||||||
// var TryCatch = require('./trycatch');
|
// var TryCatch = require('./trycatch');
|
||||||
|
|
||||||
var App = module.exports = Express.createServer();
|
//var App = module.exports = Express.createServer();
|
||||||
|
var App = Express();
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
|
|
||||||
@ -34,5 +35,5 @@ App.get('/:name', Routes.view);
|
|||||||
App.get('/:name/edit', Routes.edit);
|
App.get('/:name/edit', Routes.edit);
|
||||||
App.post('/:name', Routes.save);
|
App.post('/:name', Routes.save);
|
||||||
|
|
||||||
App.listen(process.env.PORT || 3000);
|
server = App.listen(process.env.PORT || 3000);
|
||||||
console.log("Express server listening on port %d in %s mode", App.address().port, App.settings.env);
|
console.log("Express server listening on port %d in %s mode", server.address().port, App.settings.env);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "2.5.5",
|
"express": "3.0.2",
|
||||||
"jade": ">= 0.0.1",
|
"jade": ">= 0.0.1",
|
||||||
"markdown": "~0.3.1",
|
"markdown": "~0.3.1",
|
||||||
"trycatch": "~0.0.9"
|
"trycatch": "~0.0.9"
|
||||||
|
Loading…
Reference in New Issue
Block a user