Skip to content

Commit

Permalink
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions test/truffle/simple-rack-server.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'rack'

# bin/jruby bin/gem install rack
# jt run -Ilib/ruby/gems/shared/gems/rack-1.6.1/lib simple-rack-server.rb

class Example
def call(env)
return [200, {}, ["Hello Rack!\n"]]
end
end

Rack::Handler::WEBrick.run(
Example.new,
:Port => 8080
)
2 changes: 1 addition & 1 deletion test/truffle/simple-webrick-server.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'webrick'

root = File.expand_path '~/public_html'
server = WEBrick::HTTPServer.new :Port => 8000, :DocumentRoot => root
server = WEBrick::HTTPServer.new :Port => 8080, :DocumentRoot => root

trap 'INT' do server.shutdown end

0 comments on commit 4315821

Please sign in to comment.