Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 4.12 KB

README.md

File metadata and controls

65 lines (47 loc) · 4.12 KB

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.1.1

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

2025 Dominik Zogg