Private Readonly converterPrivate Readonly handlerProtected Readonly loggerPrivate Readonly storagePrivate Readonly storagePrivate Readonly templateChecks if the input can be handled by this class. If it cannot handle the input, rejects with an error explaining why.
A promise resolving if the input can be handled, rejecting with an Error if not.
Input that could potentially be handled.
Handles the given input. This may only be called if canHandle did not reject. When unconditionally calling both in sequence, consider handleSafe instead.
A promise resolving when handling is finished.
Input that needs to be handled.
Private handleReturns the HTML representation of the setup page.
Private handleConverts the input data to JSON and calls the setup handler.
On success true will be written to the storage key.
Helper function that first runs canHandle followed by handle. Throws the error of canHandle if the data cannot be handled, or returns the result of handle otherwise.
A promise resolving if the input can be handled, rejecting with an Error if not.
Input data that will be handled if it can be handled.
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 be sent to the InteractionHandler. After successfully completing a POST request this handler will disable itself and become unreachable. All other methods will be rejected.