1.2.0 • Published 9 months ago
@chubbyts/chubbyts-http-undici-bridge v1.2.0
chubbyts-http-undici-bridge
Description
A undici req/res http bridge.
Requirements
- node: 18
- @chubbyts/chubbyts-http-types: ^1.3.1 || ^2.0.0
- undici:^7.3.0
Installation
Through NPM as @chubbyts/chubbyts-http-undici-bridge.
npm i @chubbyts/chubbyts-http-undici-bridge@^1.2.0Usage
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