1 | # Installation
|
2 | > `npm install --save @types/http-server`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for http-server (https://github.com/indexzero/http-server#readme).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-server.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-server/index.d.ts)
|
10 | ````ts
|
11 | // Type definitions for http-server 0.12
|
12 | // Project: https://github.com/indexzero/http-server#readme
|
13 | // Definitions by: York Yao <https://github.com/plantain-00>
|
14 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
15 |
|
16 | import * as http from "http";
|
17 | import * as https from "https";
|
18 | import { HandleFunction } from "connect";
|
19 |
|
20 | export function createServer(options?: Options): http.Server | https.Server;
|
21 |
|
22 | export interface Options {
|
23 | root?: string | undefined;
|
24 | headers?: { [name: string]: string } | undefined;
|
25 | cache?: number | undefined;
|
26 | showDir?: boolean | "false" | undefined;
|
27 | autoIndex?: boolean | "false" | undefined;
|
28 | showDotfiles?: boolean | undefined;
|
29 | gzip?: boolean | undefined;
|
30 | contentType?: string | undefined;
|
31 | ext?: boolean | undefined;
|
32 | before?: HandleFunction[] | undefined;
|
33 | logFn?: ((req: http.IncomingMessage, res: http.ServerResponse, err: Error) => void) | undefined;
|
34 | cors?: boolean | undefined;
|
35 | corsHeaders?: string | undefined;
|
36 | robots?: string | true | undefined;
|
37 | proxy?: string | undefined;
|
38 | https?: https.ServerOptions | undefined;
|
39 | username?: string | undefined;
|
40 | password?: string | undefined;
|
41 | }
|
42 |
|
43 | ````
|
44 |
|
45 | ### Additional Details
|
46 | * Last updated: Tue, 06 Jul 2021 21:33:37 GMT
|
47 | * Dependencies: [@types/connect](https://npmjs.com/package/@types/connect)
|
48 | * Global values: none
|
49 |
|
50 | # Credits
|
51 | These definitions were written by [York Yao](https://github.com/plantain-00).
|
52 |
|
\ | No newline at end of file |