Permalink
Browse files

Revert "Rework loading"

This reverts commit 187402a.
  • Loading branch information...
1 parent 187402a commit ed5f248f2e1ec4a60c4d7d9bd75e5fb15ee49c95 @andrew committed Mar 6, 2011
Showing with 15 additions and 9 deletions.
  1. +6 −1 config.ru
  2. +9 −8 how_much.rb
View
@@ -1,3 +1,8 @@
-require 'how_much'
+require 'rubygems'
+require 'bundler'
+
+Bundler.require
+
+require './how_much'
run HowMuch
View
@@ -1,12 +1,13 @@
-require 'rubygems'
-require 'bundler'
+require 'zoopla'
+require 'sinatra'
-Bundler.require
+class HowMuch < Sinatra::Base
+ get '/' do
+ erb :index
+ end
-get '/' do
- erb :index
+ get '/value.json' do
+ Zoopla.new(ENV['zoopla_api_key']).zed_index.in({:latitude => params[:lat], :longitude => params[:long]}).latest.to_json
+ end
end
-get '/value.json' do
- Zoopla.new(ENV['zoopla_api_key']).zed_index.in({:latitude => params[:lat], :longitude => params[:long]}).latest.to_json
-end

0 comments on commit ed5f248

Please sign in to comment.