# @stoplight/prism-http-server

> **NOTE:** The current API is still experimental and could change with no notice. Use at your own risk.

Latest version **5.16.0** (published 2026-07-17) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high maintenance score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.16.0 |
| Published | 2026-07-17 |
| First published | 2019-04-10 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=24.18.0 |
| Dependencies | 13 |
| Unpacked size | 26.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5068 |
| Author | Stoplight |
| Maintainers | stoplight-devops, mrunkle-sb, smartbear_devops |

## Links

- npm: https://www.npmjs.com/package/@stoplight/prism-http-server
- Repository: https://github.com/stoplightio/prism
- Homepage: https://github.com/stoplightio/prism#readme
- Issues: https://github.com/stoplightio/prism/issues
- npm.io page: https://npm.io/package/@stoplight/prism-http-server

## Dependencies (13)

- [fp-ts](https://npm.io/package/fp-ts.md) ^2.11.5
- [io-ts](https://npm.io/package/io-ts.md) ^2.2.16
- [micri](https://npm.io/package/micri.md) ^4.3.0
- [tslib](https://npm.io/package/tslib.md) ^2.3.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.23
- [type-is](https://npm.io/package/type-is.md) ^1.6.18
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.5
- [@scarf/scarf](https://npm.io/package/@scarf/scarf.md) ^1.4.0
- [fast-xml-parser](https://npm.io/package/fast-xml-parser.md) ^5.5.7
- [@stoplight/types](https://npm.io/package/@stoplight/types.md) ^14.1.0
- [parse-prefer-header](https://npm.io/package/parse-prefer-header.md) 1.0.0
- [@stoplight/prism-core](https://npm.io/package/@stoplight/prism-core.md) ^5.16.0
- [@stoplight/prism-http](https://npm.io/package/@stoplight/prism-http.md) ^5.16.0

## Recent versions

- 5.16.0 (latest) — 2026-07-17
- 5.13.0-beta (beta) — 2026-03-11
- 5.15.11 — 2026-06-03
- 5.15.10 — 2026-04-20
- 5.15.9 — 2026-04-17
- 5.15.8 — 2026-04-17
- 5.15.7 — 2026-04-17
- 5.12.2 — 2025-04-17
- 5.12.0 — 2024-11-13
- 5.11.0 — 2024-11-13
- 5.10.0 — 2024-09-16
- 5.9.0 — 2024-08-09
- 5.8.3 — 2024-07-19
- 5.8.2 — 2024-07-02
- 5.8.1 — 2024-04-29
- … 198 more at https://npm.io/package/@stoplight/prism-http-server/versions

## README

# Prism Server

**NOTE:** The current API is still experimental and could change with no notice. Use at your own risk.

Usage:

```javascript
const { createServer } = require('@stoplight/prism-http-server');
const { getHttpOperationsFromSpec } = require('@stoplight/prism-cli/dist/operations');
const { createLogger } = require('@stoplight/prism-core');

async function createPrismServer() {
  const operations = await getHttpOperationsFromSpec('YOUR-URL');

  const server = createServer(operations, {
    components: {
      logger: createLogger('TestLogger'),
    },
    cors: true,
    config: {
      checkSecurity: true,
      validateRequest: true,
      validateResponse: true,
      mock: { dynamic: false },
      isProxy: false,
      errors: false,
    },
  });
  await server.listen(4010);

  return {
    close: server.close.bind(server),
  };
}

const server = await createPrismServer();

server.close();
```

## Anonymized analytics

Prism uses [Scarf](https://scarf.sh/) to collect [anonymized installation analytics](https://github.com/scarf-sh/scarf-js?tab=readme-ov-file#as-a-user-of-a-package-using-scarf-js-what-information-does-scarf-js-send-about-me). These analytics help support the maintainers of this library and ONLY run during installation. To [opt out](https://github.com/scarf-sh/scarf-js?tab=readme-ov-file#as-a-user-of-a-package-using-scarf-js-how-can-i-opt-out-of-analytics), you can set the `scarfSettings.enabled` field to `false` in your project's `package.json`:

```
// package.json
{
  // ...
  "scarfSettings": {
    "enabled": false
  }
  // ...
}
```

Alternatively, you can set the environment variable `SCARF_ANALYTICS` to `false` as part of the environment that installs your npm packages, e.g., `SCARF_ANALYTICS=false npm install`.

<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=6cab5318-35c8-4dff-b6de-7007ba44442c&page=README.md" />

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