added a json IP lookup

okor 13 years ago
parent
commit
15c328f176
1 changed files with 4 additions and 0 deletions
  1. 4 0
      main.rb

+ 4 - 0
main.rb

@@ -7,6 +7,10 @@ get '/' do
7 7
 	haml :index
8 8
 end
9 9
 
10
+get '/ip.json' do
11
+	{ :ip => request.ip }.to_json
12
+end
13
+
10 14
 get '/lookup' do
11 15
 	@lookup_info = Whois.query(params[:url])
12 16
 	@formatted_response = {