diff --git a/app.rb b/app.rb index 910bb1e..c0fb7b0 100644 --- a/app.rb +++ b/app.rb @@ -363,3 +363,12 @@ route :delete, :get, :patch, :post, :put, "/status/:code" do code = Integer(params[:code]) status code if code.between? 100, 599 end + +get "/chunked/:delay" do + delay = Float(params[:delay]) + stream do |out| + out << "Hello, world!\n" + sleep delay + out << "Hello, world!\n" + end +end