Skip to content

Instantly share code, notes, and snippets.

@chinabrant
Last active December 21, 2015 15:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chinabrant/c6eb81aeebe4fa347b3b to your computer and use it in GitHub Desktop.
Save chinabrant/c6eb81aeebe4fa347b3b to your computer and use it in GitHub Desktop.
require 'Grape'
module JokesApi
class API < Grape::API
prefix "api"
resource "jokes" do
get do
Joke.all
end
get ':id' do
Joke.find(params[:id])
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment