Skip to content

Application API

The Application API provides classes and functions for creating and managing Ascender Framework applications.

It's a main entry point for initializing and configuring your application, Ascender Framework deeply depends on it.

createApplication

createApplication(app_module: type[AscModuleRef] | None = None, config: IBootstrap | None = None) -> Application

Creates an Application instance based on the provided app module or configuration.

Parameters:

Name Type Description Default
app_module type[AscModuleRef] | None

An optional application module implementing AscModuleRef.

None
config IBootstrap | None

An optional list of providers for root-level configuration.

None

Returns:

Type Description
Application

An initialized Application instance.

Raises:

Type Description
ValueError

If both app_module and config are None or specified at the same time.

Application

is_ok

is_ok() -> bool

Checks if the application has been properly initialized with a root injector.

Returns

bool True if the application is properly initialized, False otherwise.

launch

launch()

Launches application in server-mode and builds up fastapi enforcing Uvicorn to handle server part

bootstrap

bootstrap() -> FastAPI

The explicit, ordered server boot pipeline — the single place that reads top-to-bottom as "what happens at startup".

Idempotent: the first call wires everything up, subsequent calls are a no-op and just return the built ASGI app. This used to live (unnamed and unguarded) inside __call__, where mounting the routes was a hidden side effect of uvicorn invoking the factory.

Sequence
  1. Resolve environment + configure logging.
  2. Register lifecycle (startup/shutdown) handlers.
  3. Mount the router graph onto FastAPI.

See Also