Skip to content

Instantly share code, notes, and snippets.

@caevyn
Created July 2, 2014 02:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caevyn/0c6a40108334c6c9e139 to your computer and use it in GitHub Desktop.
Save caevyn/0c6a40108334c6c9e139 to your computer and use it in GitHub Desktop.
node app to render an index for gatling reports
var express = require('express'),
finder = require('finder-on-steroids');
var app = express();
app.use(express.static('../results'));
app.listen(9085);
app.get('/', function(req, res, next) {
finder('../results').files().depth(2).name('index.html').find().then(function(files) {
var html = "<ul>";
files.forEach(function(file){
var url = file.replace(/..\\results\\|\\/gi,"/");
html+="<li><a href=" + url + ">"+url+"</a></li>";
});
html +="</ul>";
res.send(html);
next();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment