UNPKG

@types/http-server

Version:
46 lines (38 loc) 1.63 kB
# Installation > `npm install --save @types/http-server` # Summary This package contains type definitions for http-server (https://github.com/indexzero/http-server#readme). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-server. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-server/index.d.ts) ````ts import { HandleFunction } from "connect"; import * as http from "http"; import * as https from "https"; export function createServer(options?: Options): http.Server | https.Server; export interface Options { root?: string | undefined; headers?: { [name: string]: string } | undefined; cache?: number | undefined; showDir?: boolean | "false" | undefined; autoIndex?: boolean | "false" | undefined; showDotfiles?: boolean | undefined; gzip?: boolean | undefined; contentType?: string | undefined; ext?: boolean | undefined; before?: HandleFunction[] | undefined; logFn?: ((req: http.IncomingMessage, res: http.ServerResponse, err: Error) => void) | undefined; cors?: boolean | undefined; corsHeaders?: string | undefined; robots?: string | true | undefined; proxy?: string | undefined; https?: https.ServerOptions | undefined; username?: string | undefined; password?: string | undefined; } ```` ### Additional Details * Last updated: Tue, 07 Nov 2023 03:09:37 GMT * Dependencies: [@types/connect](https://npmjs.com/package/@types/connect) # Credits These definitions were written by [York Yao](https://github.com/plantain-00).