actionhero
Version:
The reusable, scalable, and quick node.js API server for stateless and stateful applications
47 lines (46 loc) • 2.17 kB
TypeScript
import * as http from "http";
import * as https from "https";
import { BrowserFingerprint } from "browser_fingerprint";
import { Server, Connection } from "../index";
import { ActionProcessor } from "../classes/actionProcessor";
export declare class WebServer extends Server {
server: http.Server | https.Server;
fingerPrinter: BrowserFingerprint;
sockets: {
[id: string]: any;
};
constructor();
initialize(): Promise<void>;
start(): Promise<void>;
stop(): Promise<void>;
sendMessage(connection: Connection, message: string): Promise<void>;
sendFile(connection: Connection, error: NodeJS.ErrnoException, fileStream: any, mime: string, length: number, lastModified: Date): Promise<void>;
sendWithCompression(connection: Connection, responseHttpCode: number, headers: Array<[string, string | number]>, stringResponse: string, fileStream?: any, fileLength?: number): void;
handleRequest(req: http.IncomingMessage, res: http.ServerResponse): http.ServerResponse<http.IncomingMessage>;
completeResponse(data: ActionProcessor<any>): Promise<void>;
extractHeader(connection: Connection, match: string): any;
respondToOptions(connection: Connection): void;
respondToTrace(connection: Connection): void;
determineRequestParams(connection: Connection): Promise<any>;
fillParamsFromWebRequest(connection: Connection, varsHash: Record<string, any>): void;
transformHeaders(headersArray: Array<[string, string | number]>): Record<string, string[]>;
buildServerInformation(connectedAt: number): {
serverName: string;
apiVersion: string;
requestDuration: number;
currentTime: number;
};
buildRequesterInformation(connection: Connection): {
id: string;
fingerprint: string;
messageId: string;
remoteIP: string;
receivedParams: {
[key: string]: any;
};
};
cleanHeaders(connection: Connection): void;
cleanSocket(bindIP: string | number, port: string | number): void;
chmodSocket(bindIP: string | number, port: string | number): void;
callbackHtmlEscape(s: string): string;
}