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 |
Application
is_ok
Checks if the application has been properly initialized with a root injector.
Returns
bool True if the application is properly initialized, False otherwise.
launch
Launches application in server-mode and builds up fastapi enforcing Uvicorn to handle server part
bootstrap
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
- Resolve environment + configure logging.
- Register lifecycle (startup/shutdown) handlers.
- Mount the router graph onto FastAPI.
See Also
- Getting Started - Application setup guide
- Modules - Module system
- Dependency Injection - DI container