Created
July 2, 2014 02:07
-
-
Save caevyn/0c6a40108334c6c9e139 to your computer and use it in GitHub Desktop.
node app to render an index for gatling reports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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