A class that can be used to instantiate and start a server based on a Component.js configuration.

Hierarchy

  • AppRunner

Constructors

Properties

logger: Logger = ...

Methods

  • Handles the first Components.js instantiation. Uses it to extract the CLI shorthand values and use those to create variable bindings.

    Parameters

    • componentsManager: ComponentsManager<CliResolver>
    • argv: CliArgv
    • Optional settings: Record<string, unknown>

    Returns Promise<VariableBindings>

  • Returns an App object, created with the given config, that can start and stop the Solid server.

    Keys of the variableBindings object should be Components.js variables. E.g.: { 'urn:solid-server:default:variable:rootFilePath': '.data' }.

    shorthand are CLI argument names and their corresponding values. E.g.: { rootFilePath: '.data' }. Abbreviated parameter names can not be used, so { f: '.data' } would not work.

    The values in variableBindings take priority over those in shorthand.

    Parameters

    • loaderProperties: IComponentsManagerBuilderOptions<App>

      Components.js loader properties.

    • configFile: string | string[]

      Path to the server config file(s).

    • Optional variableBindings: VariableBindings

      Bindings of Components.js variables.

    • Optional shorthand: Shorthand

      Shorthand values that need to be resolved.

    Returns Promise<App>

  • The second Components.js instantiation, where the App is created and started using the variable mappings.

    Parameters

    • componentsManager: ComponentsManager<App>
    • variables: Record<string, unknown>

    Returns Promise<App>

  • Returns an App object, created by parsing the Command line arguments, that can start and stop the Solid server. Will exit the process on failure.

    Parameters

    • argv: CliArgv = process.argv

      Command line arguments.

    Returns Promise<App>

  • Creates the Components Manager that will be used for instantiating.

    Type Parameters

    • T

    Parameters

    • loaderProperties: IComponentsManagerBuilderOptions<T>
    • configFile: string | string[]

    Returns Promise<ComponentsManager<T>>

  • Retrieves settings from package.json or configuration file when part of an npm project.

    Returns Promise<undefined | Record<string, unknown>>

    The settings defined in the configuration file

  • Throws a new error that provides additional information through the extra message. Also appends the stack trace to the message. This is needed for errors that are thrown before the logger is created as we can't log those the standard way.

    Parameters

    • message: string
    • error: unknown

    Returns never

  • Starts the server with a given config. This method can be used to start the server from within another JavaScript application.

    Keys of the variableBindings object should be Components.js variables. E.g.: { 'urn:solid-server:default:variable:rootFilePath': '.data' }.

    shorthand are CLI argument names and their corresponding values. E.g.: { rootFilePath: '.data' }. Abbreviated parameter names can not be used, so { f: '.data' } would not work.

    The values in variableBindings take priority over those in shorthand.

    Parameters

    • loaderProperties: IComponentsManagerBuilderOptions<App>

      Components.js loader properties.

    • configFile: string | string[]

      Path to the server config file(s).

    • Optional variableBindings: VariableBindings

      Bindings of Components.js variables.

    • Optional shorthand: Shorthand

      Shorthand values that need to be resolved.

    Returns Promise<void>

  • Starts the server as a command-line application.

    Parameters

    • Optional argv: CliArgv

      Command line arguments.

    Returns Promise<void>

  • Starts the server as a command-line application. Will exit the process on failure.

    Made non-async to lower the risk of unhandled promise rejections. This is only relevant when this is used to start as a Node.js application on its own, if you use this as part of your code you probably want to use the async version.

    Parameters

    • __namedParameters: {
          argv?: CliArgv;
          stderr?: WriteStream;
      }
      • Optional argv?: CliArgv
      • Optional stderr?: WriteStream

    Returns void