.. _serving: Serving ======= Built-in -------- yli includes a trio-powered webserver that can be used to serve your app. :class:`.Webserver` takes a list of :class:`.BindInfo`, and a single parameter that is your application function. .. code-block:: python3 from yli.http import Webserver, BindInfo async def main(): webserver = Webserver([BindInfo(7777)], app) await webserver.run() trio.run(main) SSL --- SSL support can be enabled by passing a ``SSLContext`` to BindInfo: .. code-block:: python3 ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) ctx.load_cert_chain("cert.pem", "key.pem") s = Webserver([BindInfo(7777), BindInfo(7778, ssl_context=ctx)], app) await s.run()