Created
October 12, 2017 20:17
-
-
Save mkhuda/d4e938cddc131f22a61de8b7202e4d50 to your computer and use it in GitHub Desktop.
APP Class for Simple API using Ruby and Sinatra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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