Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major rewrite. Now uses local facilities.db.
- Loading branch information
1 parent
d9b91a8
commit 7a21314
Showing
12 changed files
with
262 additions
and
174 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,34 @@ | ||
#!/usr/bin/env -- ruby | ||
|
||
BASEDIR = "#{File.dirname($0)}/.." | ||
require 'rubygems' | ||
require "#{BASEDIR}/lib/findit" | ||
require 'sinatra' | ||
require 'uri' | ||
require 'json' | ||
require './lib/findit.rb' | ||
|
||
get '/nearby' do | ||
send_file "pub/nearby.html" | ||
get '/' do | ||
send_file "public/nearby.html" | ||
end | ||
|
||
get '/findit.js' do | ||
send_file "pub/findit.js" | ||
send_file "public/findit.js" | ||
end | ||
|
||
get '/about.html' do | ||
send_file "pub/about.html" | ||
send_file "public/about.html" | ||
end | ||
|
||
get '/nearby/:lat,:lng' do |lat, lng| | ||
result = FindIt.nearby(lat, lng) | ||
get '/svc/nearby/:lat,:lng' do |lat, lng| | ||
result = FindIt.nearby(lat.to_f, lng.to_f) | ||
content_type :json | ||
result.to_json | ||
end | ||
|
||
post '/nearby' do | ||
a = URI.decode_www_form(request.body.string) | ||
result = FindIt.nearby(a.assoc('latitude').last, a.assoc('longitude').last) | ||
post '/svc/nearby' do | ||
a = URI.decode_www_form(request.body.read) | ||
lat = a.assoc('latitude').last.to_f | ||
lng = a.assoc('longitude').last.to_f | ||
result = FindIt.nearby(lat, lng) | ||
content_type :json | ||
result.to_json | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'rubygems' | ||
require 'sinatra' | ||
|
||
load "./bin/findit-svc" | ||
run Sinatra::Application |
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Options -Indexes | ||
DirectoryIndex nearby.html | ||
PassengerEnabled on |
File renamed without changes.
Oops, something went wrong.