botbook/node_modules/@azure/static-web-apps-cli/dist/msha/middlewares/request.middleware.d.ts
Rodrigo Rodriguez 6ae15fe3e5 Updated.
2024-09-04 13:13:15 -03:00

29 lines
No EOL
1.7 KiB
TypeScript

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