# @types/http-server

> TypeScript definitions for http-server

Latest version **0.12.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/http-server
pnpm add @types/http-server
yarn add @types/http-server
bun add @types/http-server
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.12.4 |
| Published | 2023-11-07 |
| First published | 2017-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51442 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/http-server
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-server
- npm.io page: https://npm.io/package/@types/http-server

## Dependencies (1)

- [@types/connect](https://npm.io/package/@types/connect.md) *

## Recent versions

- 0.12.4 (latest) — 2023-11-07
- 0.12.1 (ts3.6) — 2021-07-06
- 0.10.1 (ts3.2) — 2020-10-28
- 0.10.0 (ts2.0) — 2017-10-09
- 0.12.3 — 2023-10-18
- 0.12.2 — 2023-09-16
- 0.12.0 — 2021-06-12

## README

# 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).

---
_Source: https://npm.io/package/@types/http-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
