How to use the httpstan.app function in httpstan

To help you get started, we’ve selected a few httpstan examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stan-dev / pystan-next / stan / common.py View on Github external
async def httpstan_server():
    """Manage starting and stopping the httpstan HTTP server."""
    host, port = "127.0.0.1", unused_tcp_port()
    app = httpstan.app.make_app()
    runner = aiohttp.web.AppRunner(app)
    await runner.setup()
    site = aiohttp.web.TCPSite(runner, host, port)
    await site.start()
    yield (host, port)
    await runner.cleanup()