@chubbyts/chubbyts-http-undici-bridge
v1.0.2
Published
A undici req/res http bridge.
Downloads
7
Readme
chubbyts-http-undici-bridge
Description
A undici req/res http bridge.
Requirements
- node: 18
- @chubbyts/chubbyts-http-types: ^1.2.3
- undici:^6.19.0
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