Skip to content

Instantly share code, notes, and snippets.

@lgs
Forked from djones/gist:2642094
Created July 3, 2012 19:51
Show Gist options
  • Save lgs/3042501 to your computer and use it in GitHub Desktop.
Save lgs/3042501 to your computer and use it in GitHub Desktop.
Grape API being served with Goliath
#!/usr/bin/env ruby
# gem install grape --pre
# http://localhost:9000/hello.json
# => {"hello":"world"}
$:<< '../lib' << 'lib'
require 'goliath'
require 'grape'
class MyAPI < Grape::API
get "hello" do
{:hello => "world"}
end
end
class APIServer < Goliath::API
def call(env)
MyAPI.call(env)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment