Created
October 17, 2011 18:27
-
-
Save drogus/1293368 to your computer and use it in GitHub Desktop.
request streaming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# runs only on jruby | |
# | |
# Usage: | |
# gem install kirk | |
# kirk -c Kirkfile | |
app = lambda do |env| | |
response_body = [] | |
body = env["rack.input"] | |
while chunk = body.read(4) | |
p "Received chunk: #{chunk}" | |
response_body << chunk | |
end | |
[200, {}, response_body] | |
end | |
run app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log :level => :all | |
rack "config.ru" do | |
listen 3030 | |
# Set the file that controls the redeploys. This is relative to | |
# the applications root (the directory that the rackup file lives | |
# in). Touch this file to redepoy the application. | |
watch "config.ru" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment