diff --git a/cpi_feed.rb b/cpi_feed.rb index 3689ca7..9878037 100644 --- a/cpi_feed.rb +++ b/cpi_feed.rb @@ -8,6 +8,8 @@ class CPIFeed < Sinatra::Base get '/' do resp = JSON.parse(Faraday.get(cpi_series_url).body) + halt 502 unless resp['Results']['series'] + expires 300, :public, :must_revalidate content_type :csv "cpi\n#{resp['Results']['series'].first['data'].first['value']}\n"