Skip to content

Instantly share code, notes, and snippets.

@djones
Created May 9, 2012 05:26
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save djones/2642094 to your computer and use it in GitHub Desktop.
Save djones/2642094 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