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 sys = require('sys'), | |
spawn = require('child_process').spawn, | |
http = require('http'); | |
http.createServer(function (req, res) { | |
var ffmpeg = spawn('ffmpeg', ['-i /path/to/file', '-f mp3', '-']); | |
res.writeHead(200, {'Content-Type': 'audio/mpeg'}); | |
ffmpeg.stdout.addListener('data', function (d) { |
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
# This module allows you to prepend a verion prefix to your Sinatra URLs | |
# Example: | |
# | |
# require 'rubygems' | |
# require 'sinatra/base' | |
# | |
# class App < Sinatra::Base | |
# register Versioned | |
# | |
# set :version, 'v1' |