Created
October 8, 2020 08:12
-
-
Save rob-blackbourn/fff5eae2449858b3062e6908c103e75e to your computer and use it in GitHub Desktop.
Graphene 3 example server
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
import asyncio | |
import signal | |
from typing import Any, Mapping | |
from bareasgi import Application | |
import pkg_resources | |
import hypercorn.asyncio | |
import hypercorn.config | |
from demo.app import make_application | |
def start_server(): | |
app = make_application() | |
config = hypercorn.config.Config() | |
config.bind = ["0.0.0.0:10001"] | |
config.loglevel = 'debug' | |
asyncio.run( | |
hypercorn.asyncio.serve(app, config) | |
) | |
if __name__ == '__main__': | |
start_server() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment