Last active
December 17, 2015 18:59
-
-
Save venj/5657468 to your computer and use it in GitHub Desktop.
Simple sinatra server for stream video to iOS.
Now, more ruby style. :)
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
require "rubygems" | |
require "sinatra" | |
require "json" | |
set :public_folder, Dir.pwd | |
get "/" do | |
content_type 'application/json' | |
Dir["**/*"].select { |f| ["mp4", "m4v"].include? f.split(".").last.downcase }.to_json | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment