from vibora import Vibora, Request, Response
# Config will be a new component.
self.name = 'Vibora Component'
# Registering the config instance.
app.add_component(Config())
async def home(request: Request, config: Config):
Notice that if you specify a parameter of type "Config"
Vibora will automatically provide the config instance registered previously.
Instead of adding global variables you can now register new components,
that are easily testable and accessible.
# You could also ask for the Config component at runtime.
current_config = request.get_component(Config)
assert current_config is config
return Response(config.name)