Skip to content

Commit f44534a

Browse files
committed
Pack a little webserver to protoype both cli & online tests
1 parent 629cf1c commit f44534a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

_tests/server.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var http = require('http');
2+
var send = require('send');
3+
var port = process.env.PORT || 8080;
4+
5+
http.createServer(function(req, res) {
6+
if (req.url === '/') {
7+
res.writeHead(301, {'Location': '/_tests/index.html'});
8+
res.end();
9+
return;
10+
}
11+
12+
send(req, req.url)
13+
.root(__dirname+'/../')
14+
.pipe(res);
15+
}).listen(port);
16+
17+
console.log('Test demo running at http://localhost:' + port + '/');

0 commit comments

Comments
 (0)