Skip to content

Instantly share code, notes, and snippets.

@nnabeyang
Created July 31, 2012 03:55
Show Gist options
  • Save nnabeyang/3213385 to your computer and use it in GitHub Desktop.
Save nnabeyang/3213385 to your computer and use it in GitHub Desktop.
ctrl+cでrackサーバーをシャットダウンする
require './hello_rack'
run HelloRack.new
require 'rack'
class HelloRack
def call(env)
[200, {'Content-Type' => 'text/plain'}, ['Hello, Rack!']]
end
end
require 'rack'
#usage ./hello_rack_main --port PORT hello.ru
Rack::Server.new.tap do|server|
server.start
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment