UNPKG

1.19 kBTypeScriptView Raw
1// Type definitions for http-server 0.12
2// Project: https://github.com/indexzero/http-server#readme
3// Definitions by: York Yao <https://github.com/plantain-00>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6import * as http from "http";
7import * as https from "https";
8import { HandleFunction } from "connect";
9
10export function createServer(options?: Options): http.Server | https.Server;
11
12export interface Options {
13 root?: string | undefined;
14 headers?: { [name: string]: string } | undefined;
15 cache?: number | undefined;
16 showDir?: boolean | "false" | undefined;
17 autoIndex?: boolean | "false" | undefined;
18 showDotfiles?: boolean | undefined;
19 gzip?: boolean | undefined;
20 contentType?: string | undefined;
21 ext?: boolean | undefined;
22 before?: HandleFunction[] | undefined;
23 logFn?: ((req: http.IncomingMessage, res: http.ServerResponse, err: Error) => void) | undefined;
24 cors?: boolean | undefined;
25 corsHeaders?: string | undefined;
26 robots?: string | true | undefined;
27 proxy?: string | undefined;
28 https?: https.ServerOptions | undefined;
29 username?: string | undefined;
30 password?: string | undefined;
31}
32
\No newline at end of file