Skip to content

Instantly share code, notes, and snippets.

@djones
Created May 4, 2012 18:38
Show Gist options
  • Save djones/2596822 to your computer and use it in GitHub Desktop.
Save djones/2596822 to your computer and use it in GitHub Desktop.
Sudocode on how I would like Grape to work with Goliath
# Sudocode on how I would like grape to work with Goliath
# http://localhost:9000/randomuser #=> random user in json
require 'goliath'
require 'grape'
require 'em-synchrony/activerecord'
class User < ActiveRecord::Base
end
class MyAPI < Grape::API
get 'randomuser' do
User.offset(rand(User.count)).first
end
end
class Srv < Goliath::API
map "/" do
run MyAPI.new(self)
end
end
@djones
Copy link
Author

djones commented May 12, 2012

@jpfuentes2 do you have any other examples of Goliath and REST APIs? Or know of any out there?

Now I've created a Goliath + Grape example here: https://github.com/djones/grape-goliath-example I'm interested to write the same example just with Goliath and see how it compares speed wise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment