Skip to content

Instantly share code, notes, and snippets.

@rob-blackbourn
Created October 8, 2020 08:12
Show Gist options
  • Save rob-blackbourn/fff5eae2449858b3062e6908c103e75e to your computer and use it in GitHub Desktop.
Save rob-blackbourn/fff5eae2449858b3062e6908c103e75e to your computer and use it in GitHub Desktop.
Graphene 3 example server
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