-
-
Save anonymous/c5790c498ee9ecb15491 to your computer and use it in GitHub Desktop.
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
class Yank < Sinatra::Base | |
# CONSISTENCY | |
Tilt.register(Tilt::ERBTemplate, 'html.erb') | |
helpers do | |
def config | |
config = YAML.load_file('./config.yml') | |
end | |
def redis | |
redis ||= Redis.new(:path => config['redis_socket']) | |
end | |
end | |
get '/' do | |
@host = config['base_url'] | |
erb :index | |
end | |
get '/:slug' do | |
@slug = params[:slug] | |
Tempfile.open('crate') do |temp_file| | |
data = "GARBAGE" | |
temp_file.write(data) | |
temp_file.close | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment