@chubbyts/chubbyts-http-undici-bridge

1.0.0 • Public • Published

chubbyts-http-undici-bridge

CI Coverage Status Mutation testing badge npm-version

bugs code_smells coverage duplicated_lines_density ncloc sqale_rating alert_status reliability_rating security_rating sqale_index vulnerabilities

Description

A undici req/res http bridge.

Requirements

Installation

Through NPM as @chubbyts/chubbyts-http-undici-bridge.

npm i @chubbyts/chubbyts-http-undici-bridge@^1.0

Usage

import {
  createServerRequestFactory,
  createUriFactory,
} from '@chubbyts/chubbyts-http/dist/message-factory';
import { createUndiciToServerRequestFactory, createResponseToUndiciFactory } from '@chubbyts/chubbyts-http-undici-bridge/dist/undici-http';

const app = ...;

const undiciToServerRequestFactory = createUndiciToServerRequestFactory(
  createUriFactory(),
  createServerRequestFactory(),
);

const responseToUndiciFactory = createResponseToUndiciFactory();

const res = responseToUndiciFactory(await app(undiciToServerRequestFactory(req)));

Copyright

2024 Dominik Zogg

Readme

Keywords

Package Sidebar

Install

npm i @chubbyts/chubbyts-http-undici-bridge

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

9.93 kB

Total Files

6

Last publish

Collaborators

  • dominikzogg