asphalt.web.litestar
- class asphalt.web.litestar.AsphaltProvide(cls, name='default')
Bases:
object
Asphalt’s version of Litestar’s
Provide()
.This should be marked as the default value on a parameter that should receive an Asphalt resource.
- class asphalt.web.litestar.LitestarComponent(components=None, *, host='127.0.0.1', port=8000, route_handlers=(), middlewares=(), config=None)
Bases:
ASGIComponent
[Litestar
]A component that serves a Litestar application.
- Parameters:
host – the IP address to bind to
port – the port to bind to
route_handlers – list of callables or module:varname references that point to the routers / controolers / handlers that should be attached to the application
middlewares – list of callables or dicts to be added as middleware using
add_middleware()
Note
The following options are preset here:
debug
: set to the value of __debug__; unless overriddenlogging_config
: always set toNone
, as Asphalt handles logging configuration
If you supply the a pre-made application object that has route handlers already in it, know that any middleware added to it during the initialization of
LitestarComponent
will NOT apply to the route handlers previously added to the application