Skip to content

Instantly share code, notes, and snippets.

@xiejiangzhi
Last active March 29, 2016 03:09
Show Gist options
  • Save xiejiangzhi/41c33598c86a4617ee18 to your computer and use it in GitHub Desktop.
Save xiejiangzhi/41c33598c86a4617ee18 to your computer and use it in GitHub Desktop.
ruby test web
require 'rack'
app = Proc.new do |env|
['200', {'Content-Type' => 'text/html'}, ['Hello, this is a rack app.']]
end
port = ENV['PORT'] || 8080
Rack::Handler::WEBrick.run app, Port: port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment