Skip to content

Instantly share code, notes, and snippets.

@chrisseto
Last active August 29, 2015 13:57
Show Gist options
  • Save chrisseto/9655858 to your computer and use it in GitHub Desktop.
Save chrisseto/9655858 to your computer and use it in GitHub Desktop.
A small and simple video browser/streamer in nodejs
var fs = require('fs')
var util = require('util')
var express = require('express');
var serveIndex = require('serve-index');
var querystring = require('querystring');
var app = express();
app.use(serveIndex(__dirname, {
'icons': true
}));
app.use('/static', express.static(__dirname));
app.get(/^\/(?!static).*\.(mp4|mkv)/, function(request, response) {
console.log("Request:", request.path)
var path = querystring.unescape(request.path);
response.redirect('/static' + path);
});
var server = app.listen(3005, function() {
console.log('Listening on port %d', server.address().port);
});
@chrisseto
Copy link
Author

Mkv's dont always have audio... Attempting to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment