Add endpoint for chunked transfer
All checks were successful
Gitea Actions Demo / lint (push) Successful in 1m22s
Gitea Actions Demo / test (push) Successful in 1m20s
Gitea Actions Demo / release-image (push) Successful in 1m14s

This commit is contained in:
Ryan Cavicchioni 2024-08-20 20:02:21 -05:00
parent d52786aa44
commit e570a2e3c8
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

9
app.rb
View File

@ -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