Skip to content

Instantly share code, notes, and snippets.

@anandtripathi5
Last active May 22, 2021 12:15
Show Gist options
  • Save anandtripathi5/972e5df292ac763c1ee9e7b608f317fa to your computer and use it in GitHub Desktop.
Save anandtripathi5/972e5df292ac763c1ee9e7b608f317fa to your computer and use it in GitHub Desktop.
Flask 2.0 now supports asynchronous route handlers
from flask import Flask
import asyncio
app = Flask(__name__)
@app.get("/data")
async def get_data():
await asyncio.sleep(1)
return 'Hello'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment