I am trying to stream multiple video files in a single request with a node.js application written in coffescript. Here is my code:
express = require 'express'
app = express.createServer(
express.compiler(src: __dirname + '/client', enable: ['coffeescript']),
#express.static(__dirname + '/client'),
express.errorHandler dumpExceptions: true, showStack: true
)
app.get('/video/:number', (req, res) ->
console.log 'sending'
res.sendfile("sample#{req.params.number}.webm")
)
port = 3000
app.listen port
So far I manage to send a single file and I can point to any video file which name is formatted like sample<number>.webm
. My goal is to be able to send all files inside a folder with that same name format but with a single request, meaning that when the users point the browser to http://localhost:3000
for example, videos would be shown as if they were one single video.