mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Applied black
This commit is contained in:
parent
7cdc55c683
commit
d736411699
1 changed files with 10 additions and 16 deletions
|
|
@ -78,24 +78,18 @@ class AsgiRouter:
|
|||
|
||||
|
||||
async def hello_world(scope, receive, send):
|
||||
assert scope['type'] == 'http'
|
||||
await send({
|
||||
'type': 'http.response.start',
|
||||
'status': 200,
|
||||
'headers': [
|
||||
[b'content-type', b'text/html'],
|
||||
]
|
||||
})
|
||||
await send({
|
||||
'type': 'http.response.body',
|
||||
'body': b'<h1>Hello world!</h1>',
|
||||
})
|
||||
assert scope["type"] == "http"
|
||||
await send(
|
||||
{
|
||||
"type": "http.response.start",
|
||||
"status": 200,
|
||||
"headers": [[b"content-type", b"text/html"]],
|
||||
}
|
||||
)
|
||||
await send({"type": "http.response.body", "body": b"<h1>Hello world!</h1>"})
|
||||
|
||||
|
||||
|
||||
app = AsgiRouter([
|
||||
('/hello/', hello_world),
|
||||
])
|
||||
app = AsgiRouter([("/hello/", hello_world)])
|
||||
|
||||
|
||||
class AsgiView(HTTPMethodView):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue