Options
All
  • Public
  • Public/Protected
  • All
Menu

Handles the initial setup of a server. Will capture all requests until setup is finished, this to prevent accidentally running unsafe servers.

GET requests will return the view template which should contain the setup information for the user. POST requests will run an initializer and/or perform a registration step, both optional. After successfully completing a POST request this handler will disable itself and become unreachable. All other methods will be rejected.

Hierarchy

Index

Constructors

constructor

Properties

Private Readonly converter

Private Readonly errorHandler

errorHandler: ErrorHandler

Private finished

finished: boolean

Private Optional Readonly initializer

initializer?: Initializer

Protected Readonly logger

logger: Logger = ...

Private Optional Readonly registrationManager

registrationManager?: RegistrationManager

Private Readonly responseTemplate

responseTemplate: string

Private Readonly storage

storage: KeyValueStorage<string, boolean>

Private Readonly storageKey

storageKey: string

Private Readonly viewTemplate

viewTemplate: string

Methods

canHandle

Private getJsonResult

  • getJsonResult(operation: Operation): Promise<{ json: Record<string, any>; template: string }>
  • Creates a JSON object representing the result of executing the given operation, together with the template it should be applied to.

    Parameters

    Returns Promise<{ json: Record<string, any>; template: string }>

handle

handleSafe