1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# run this with : # rackup hello.ru app1 = Proc {|env| [200, {'Content-Type'=>'text/html', 'hello world!'] } @app = app end if env['PATH_INFO'] =~ %r{/goodbye} [200, {'Content-Type'=>'text/html'}, 'goodbye world!'] else @app(env) end end end use Goodbye run app1 |

