Stratal API Reference
    Preparing search index...

    Class Application

    Application

    Main application class managing the two-tier container hierarchy:

    • Global Container: All services (singletons via tsyringe native)
    • Request Container: Child of global, context-enriched instances per request
    const app = new Application({ module: AppModule, env, ctx })
    await app.initialize()

    // Access container via getter
    const service = app.container.resolve(MY_TOKEN)

    // Handle HTTP request (via HonoApp)
    // Handle queue batch
    await app.handleQueue(batch, 'my-queue')
    Index

    Constructors

    Properties

    Accessors

    • get container(): Container

      Get the Container instance

      Returns Container

    Methods

    • Create mock RouterContext for queue/cron/seeder processing

      Parameters

      • locale: string = 'en'

      Returns RouterContext

    • Lazily initialize routing and return the HonoApp instance.

      Routing (service registration, HonoApp resolution, route configuration) is deferred so that scheduled and queue handlers don't pay the CPU cost of route setup on cold start.

      Returns Promise<HonoApp>

    • Execute a command by name in a request-scoped container.

      Parameters

      • name: string
      • Optionalinput: CommandInput

      Returns Promise<CommandResult>

    • Handle queue batch processing

      Parameters

      • batch: MessageBatch
      • queueName: string

      Returns Promise<void>

    • Handle scheduled cron trigger

      Parameters

      • controller: ScheduledController

      Returns Promise<void>

    • Resolve a service from the container

      Type Parameters

      • T

      Parameters

      • token: symbol

      Returns T