Created
March 14, 2018 10:57
-
-
Save paradoxxxzero/4d587a21889b3f83bd8cd991ab581fdb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from time import sleep | |
from flask import Flask, Response | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
def gen(*args): | |
for i in range(1000): | |
yield f'I am {i}' | |
sleep(.02) | |
yield 'Done' | |
return Response(gen()) | |
app.run() | |
# curl -N http://localhost:5000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment