Skip to content

Instantly share code, notes, and snippets.

@eiel

eiel/app.rb Secret

Created March 29, 2014 02:10
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 eiel/b4c6e39bf9b694022b17 to your computer and use it in GitHub Desktop.
Save eiel/b4c6e39bf9b694022b17 to your computer and use it in GitHub Desktop.
広島岡山交流会01 でのサンプルコード http://hirosimaokayamarb.doorkeeper.jp/events/8993
require 'action_dispatch'
header = {'Content-Type' => 'text/html'}
routes = ActionDispatch::Routing::RouteSet.new
routes.draw do
get 'hello', to: -> env { [200, header, ['hello']] }
get 'goodbye', to: -> env { [200, header, ['goobye']] }
root to: -> env { [200, header, ['Hiroshima Okayama rb']]}
end
Rack::Handler.default.run routes, Port: 3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment