Skip to content

expressMiddleware

expressMiddleware(): Middleware

The expressMiddleware function is a TypeScript function that creates an Express middleware that sets the ctx.body property to the event.body value and calls the next function.

Returns

Middleware

A middleware function that will handle request event and extract body.

Example

import expressMiddleware from '@chord-ts/rpc/middlewares';
// ...
composer.use(expressMiddleware());

Source

middlewares/express.ts:14