Skip to main content

IHttpServer

Implement this interface to create custom HTTP server adapter for AdminForth.

Extended by

Methods

endpoint()

endpoint(options): void

Method which should register endpoint in HTTP server.

Parameters

ParameterTypeDescription
optionsobject: Object with method, path and handler properties.
options.handler(body, adminUser, query, headers, cookies, response) => void-
options.methodstring-
options.noAuth?boolean-
options.pathstring-

Returns

void


setupSpaServer()

setupSpaServer(): void

Sets up HTTP server to serve AdminForth SPA. if hotReload is true, it should proxy all requests and headers to Vite dev server at http://localhost:5173$\{req.url\} otherwise it should serve AdminForth SPA from dist folder. See Express for example.

Returns

void