浏览代码

Add Phantomas metadata to the page

Gaël Métais 11 年之前
父节点
当前提交
8c6666a33c
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      app/node_controllers/resultsController.js

+ 5 - 0
app/node_controllers/resultsController.js

@@ -20,6 +20,10 @@ var resultsController = function(req, res) {
             fs.readFile('./app/node_views/results.html', {encoding: 'utf8'}, callback);
         },
 
+        phantomasMetadata: function(callback) {
+            fs.readFile('./node_modules/phantomas/lib/metadata/metadata.json', {encoding: 'utf8'}, callback);
+        },
+
         phantomasResults: function(callback) {
             fs.readFile(phantomasResultsPath, {encoding: 'utf8'}, callback);
         }
@@ -31,6 +35,7 @@ var resultsController = function(req, res) {
         }
 
         var html = results.htmlTemplate;
+        html = html.replace('%%METADATA%%', results.phantomasMetadata);
         html = html.replace('%%RESULTS%%', results.phantomasResults);
 
         res.setHeader('Content-Type', 'text/html');