Express has no method configure error Express has no method configure error express express

Express has no method configure error


Tom in his blog post new-features-node-express-4 provides examples of how to convert from using app.configure in express version 3.x to removing it in express version 4.0.

For convenience I added the code example below.

Version 3.x

// all environmentsapp.configure(function(){  app.set('title', 'Application Title');})// development onlyapp.configure('development', function(){  app.set('mongodb_uri', 'mongo://localhost/dev');})// production onlyapp.configure('production', function(){  app.set('mongodb_uri', 'mongo://localhost/prod');})

Version 4.0

// all environmentsapp.set('title', 'Application Title');// development onlyif ('development' == app.get('env')) {  app.set('mongodb_uri', 'mongo://localhost/dev');}// production onlyif ('production' == app.get('env')) {  app.set('mongodb_uri', 'mongo://localhost/prod');}


The configure method has been removed from express as of version 4.0.0 (including 4.0.0-rc2). See the changelog at https://github.com/strongloop/express/blob/master/History.md#400--2014-04-09