UNPKG

@azure/static-web-apps-cli

Version:
29 lines 1.72 kB
import type http from "node:http"; import httpProxy from "http-proxy"; import type net from "node:net"; /** * On connection lost handler. Called when a connection to a target host cannot be made or if the remote target is down. * @param req Node.js HTTP request object. * @param res Node.js HTTP response object. * @param target The HTTP host target. * @returns A callback function including an Error object. */ export declare function onConnectionLost(req: http.IncomingMessage, res: http.ServerResponse | net.Socket, target: string | undefined, prefix?: string): (error: Error) => void; /** * * @param appLocation The location of the application code, where the application configuration file is located. * @returns The JSON content of the application configuration file defined in the `staticwebapp.config.json` file (or legacy file `routes.json`). * If no configuration file is found, returns `undefined`. * @see https://docs.microsoft.com/azure/static-web-apps/configuration */ export declare function handleUserConfig(appLocation: string | undefined): Promise<SWAConfigFile | undefined>; /** * * @param req Node.js HTTP request object. * @param res Node.js HTTP response object. * @param proxyApp An `http-proxy` instance. * @param userConfig The application configuration file defined in the `staticwebapp.config.json` file (or legacy file `routes.json`). * @returns This middleware mutates the `req` and `res` HTTP objects. */ export declare function requestMiddleware(req: http.IncomingMessage, res: http.ServerResponse, proxyApp: httpProxy, userConfig: SWAConfigFile | undefined): Promise<void | http.ServerResponse<http.IncomingMessage>>; //# sourceMappingURL=request.middleware.d.ts.map