In Express 3.0, you normally wocould use app. configure () (or app. use () to set up the required middleware you need. those middleware you specified are bundled together with Express 3.0.
E.g.
var express = require('express');var routes = require('./routes');var user = require('./routes/user');var http = require('http');var path = require('path');var app = express();// all environmentsapp.set('port', process.env.PORT || 3000);app.set('views', path.join(__dirname, 'views'));app.set('view engine', 'jade');app.use(express.favicon());app.use(express.logger('dev'));app.use(express.compress());app.use(express.json());app.use(express.urlencoded());app.use(express.methodOverride());
In Express 4.0 however, all middleware have been removed so that they can be maintained and update independently from the core Express (could t the static middleware ), thus they need to be called separately (what you see in app. js ).
Thebin\
Directory serve as a location where you can define your various startup scripts,www
Is an example on how it showould looks like, ultimately you cowould have startup script liketest
,stop
Orrestart
Etc. Having this structure allows you to have different deployments without touching the app. js.
So the correct start method isnpm start