Skip to content

Instantly share code, notes, and snippets.

@mkhuda
Created October 12, 2017 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkhuda/d4e938cddc131f22a61de8b7202e4d50 to your computer and use it in GitHub Desktop.
Save mkhuda/d4e938cddc131f22a61de8b7202e4d50 to your computer and use it in GitHub Desktop.
APP Class for Simple API using Ruby and Sinatra
require "sinatra"
require_relative "my_db"
class App < Sinatra::Base
get '/' do
return "Hello from Sinatra.rb"
end
get '/show_komedian' do
content_type :json
@database = MyDatabase.new
return @database.select_all_komedian
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment