]> CyberLeo.Net >> Repos - CDN/metadata.git/blob - app.rb
Screwing around
[CDN/metadata.git] / app.rb
1 require 'sinatra/base'
2 require 'sinatra/json'
3 require 'yajl'
4 require 'yajl/json_gem'
5
6 $tracklist = [
7   { index: 1,
8     title: 'Lucky Star - ???? Sailor Fuku',
9     metadata: '',
10     length: 200,
11     bpm: 141,
12     notes: 'Pitch this one up to about 150-155 to mix with the next track; mix in at ~3:14'
13   },
14   { index: 2,
15     title: 'M-Project - Cherry',
16     metadata: 'M-Project - Cherry',
17     length: 216,
18     bpm: 160,
19     notes: 'Start this one slow and speed up after mixing last track out'
20   },
21 ]
22
23 def tracklist_json
24   $tracklist.to_json
25 end
26
27 class App < Sinatra::Base
28   configure do
29     set :protection, :except => :frame_options
30   end
31
32   get '/tracklist.json' do
33     json $tracklist
34   end
35
36   get '/js/handler.js' do
37     content_type 'text/javascript'
38     erb :handler_js
39   end
40
41   get '/css/meta.css' do
42     content_type 'text/css'
43     erb :meta_css
44   end
45
46   get '/' do
47     erb :index, :locals => { :tracklist => tracklist_json }
48   end
49 end