As of Express 4.x, the directory middleware is no longer bundled with express. You'll want to download the npm module serve-index.
Then, for example, to display the file/dir listings in a directory at the root of the app called videos
would look like:
var serveIndex = require('serve-index');
app.use(express.static(__dirname + "/"))
app.use('/videos', serveIndex(__dirname + '/videos'));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…