- serveStatic(_: IncomingMessage, res: ServerResponse, filePath: string, defaultPath?: string, defaultCode?: number, headers?: ((filePath: string) => OutgoingHttpHeaders)): Promise<void>
-
Parameters
-
_: IncomingMessage
-
res: ServerResponse
-
filePath: string
-
Optional defaultPath: string
-
Optional defaultCode: number
-
headers: ((filePath: string) => OutgoingHttpHeaders) = ...
-
- (filePath: string): OutgoingHttpHeaders
-
Returns OutgoingHttpHeaders
Returns Promise<void>
Method for serving the static file at filePath to a client, streamed; if there's none, the file at defaultPath with defaultCode, else a 404.