Application unit that loads the various route files from app/http/routes and pre-compiles the route handlers.

Hierarchy

Constructors

Properties

bus: Bus<Event>
compiledRoutes: Collection<Route<unknown, unknown[]>> = ...
config: Config
logging: Logging
status: UnitStatus = UnitStatus.Stopped

The current status of the unit.

Accessors

Methods

  • This method is called to stop the unit when the application is shutting down. Here, you should do any teardown required to stop the package cleanly.

    IN PARTICULAR take care to free blocking resources that could prevent the process from exiting without a kill.

    Returns void | Promise<void>

  • Resolve a UniversalPath to a file served as an asset.

    Example

    this.getAssetPath('images', '123.jpg').toRemote  // => http://localhost:8000/assets/images/123.jpg
    

    Parameters

    • Rest ...parts: string[]

    Returns UniversalPath

  • Get the method with the given name from this class, bound to this class.

    Returns

    function

    Parameters

    • methodName: string

    Returns ((...args: any[]) => any)

      • (...args: any[]): any
      • Get the method with the given name from this class, bound to this class.

        Returns

        function

        Parameters

        • Rest ...args: any[]

        Returns any

  • Call the make() method on the global container.

    Type Parameters

    • T

    Parameters

    • target: any
    • Rest ...parameters: any[]

    Returns T

  • Given an HTTPMethod and route path, return the Route instance that matches them, if one exists.

    Parameters

    Returns undefined | Route<unknown, unknown[]>

  • Recompile registered routes into resolved handler stacks.

    Returns Promise<void>

  • Register built-in servers and routes.

    Returns Promise<void>

  • Register an asset directory for the given package. This creates a static server route for the package with the configured vendor prefix.

    Parameters

    Returns Promise<void>

  • This method is called to start the unit when the application is booting. Here, you should do any setup required to get the package up and running.

    Returns Promise<void>