Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

my initial commit

  • Loading branch information...
commit 79557f59e2d337428552143c882c3148e08f0b67 0 parents
@kanedaki authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 classes/indexer.rb
13 classes/indexer.rb
@@ -0,0 +1,13 @@
+require 'goliath'
+require 'em-synchrony/em-http'
+
+class Indexer < Goliath::API
+ use Goliath::Rack::Params # parse query & body params
+ use Goliath::Rack::Formatters::JSON # JSON output formatter
+ use Goliath::Rack::Render # auto-negotiate response format
+
+ def response(env)
+ gh = EM::HttpRequest.new("http://www.google.com").get
+ [200, {'X-Goliath' => 'Proxy'}, gh.response]
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.