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
Parameter | Type | Description |
---|---|---|
options | object | : Object with method, path and handler properties. |
options.handler | (body , adminUser , query , headers , cookies , response ) => void | - |
options.method | string | - |
options.noAuth ? | boolean | - |
options.path | string | - |
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