UNPKG

@solid/community-server

Version:

Community Solid Server: an open and modular implementation of the Solid specifications

24 lines (23 loc) 1.08 kB
import type { Server } from 'node:http'; import type { HttpHandler } from './HttpHandler'; import { ServerConfigurator } from './ServerConfigurator'; /** * A {@link ServerConfigurator} that attaches an {@link HttpHandler} to the `request` event of a {@link Server}. * All incoming requests will be sent to the provided handler. * Failsafes are added to make sure a valid response is sent in case something goes wrong. * * The `showStackTrace` parameter can be used to add stack traces to error outputs. */ export declare class HandlerServerConfigurator extends ServerConfigurator { protected readonly logger: import("global-logger-factory").Logger<unknown>; protected readonly errorLogger: (error: Error) => void; /** The main HttpHandler */ private readonly handler; private readonly showStackTrace; constructor(handler: HttpHandler, showStackTrace?: boolean); handle(server: Server): Promise<void>; /** * Creates a readable error message based on the error and the `showStackTrace` parameter. */ private createErrorMessage; }