mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-24 20:15:15 +01:00
Remove API redirect
This commit is contained in:
parent
2ca8c06af6
commit
804572f0b8
12
lib/app.rb
12
lib/app.rb
@ -6,12 +6,6 @@ require 'yajl'
|
||||
set :root, File.expand_path('..', File.dirname(__FILE__))
|
||||
|
||||
helpers do
|
||||
def redirect_to_api
|
||||
if request.url.include? 'https://f'
|
||||
redirect request.url.sub %r{//}, '//api.'
|
||||
end
|
||||
end
|
||||
|
||||
# Ugly as fuck.
|
||||
def snapshot
|
||||
quotes = Snapshot
|
||||
@ -32,15 +26,9 @@ get '/' do
|
||||
end
|
||||
|
||||
get '/latest' do
|
||||
redirect_to_api if production?
|
||||
jsonp snapshot
|
||||
end
|
||||
|
||||
get '/:date' do
|
||||
redirect_to_api if production?
|
||||
jsonp snapshot
|
||||
end
|
||||
|
||||
error do
|
||||
"Something is rotten in the state of Denmark."
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user