Thursday, 19 September 2013

ExpressJs - where express.static(__dirname) point to?

ExpressJs - where express.static(__dirname) point to?

var express = require('express');
var app = express();
port = process.argv[2] || 8000;
app.configure(function () {
app.use(
"/",
express.static(__dirname)
);
});
app.listen(port);
I removed this piece of line below and i got an error while loading localhost
app.configure(function () {
app.use(
"/",
express.static(__dirname)
);
});
What does the app.use method do?.
What does the express.static method do? and where does the __dirname
points to?.

No comments:

Post a Comment