Commits

Magnus Hoff committed 1a8808b

Set the Server-header based on information from package.json

  • Participants
  • Parent commits 01b61af

Comments (0)

Files changed (1)

 var fs = require('fs');
 
 
+var module = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf-8'));
+
+
 function verifyNew(that, fname) {
     if (this === that) throw "Missing new on invocation of constructor " + fname;
 }
     return http.createServer(function (req, res) {
         console.log('[req] ' + req.url);
 
-        res.setHeader("Server", "resource-tree/0.0.0");
+        res.setHeader("Server", module.name + "/" + module.version);
 
         pathname = url.parse(req.url).pathname;
         Lookup.prototype.doLookup(root, pathname, function(resource) {