Skip to content

chubbyts/chubbyts-http-undici-bridge

Repository files navigation

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

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

About

A undici req/res http bridge.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published