require 'sinatra/base' require 'sinatra/json' require 'yajl' require 'yajl/json_gem' $tracklist = [ { index: 1, title: 'Lucky Star - ???? Sailor Fuku', metadata: '', length: 200, bpm: 141, notes: 'Pitch this one up to about 150-155 to mix with the next track; mix in at ~3:14' }, { index: 2, title: 'M-Project - Cherry', metadata: 'M-Project - Cherry', length: 216, bpm: 160, notes: 'Start this one slow and speed up after mixing last track out' }, ] def tracklist_json $tracklist.to_json end class App < Sinatra::Base configure do set :protection, :except => :frame_options end get '/tracklist.json' do json $tracklist end get '/js/handler.js' do content_type 'text/javascript' erb :handler_js end get '/css/meta.css' do content_type 'text/css' erb :meta_css end get '/' do erb :index, :locals => { :tracklist => tracklist_json } end end