Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 502 Bytes

echomock.md

File metadata and controls

15 lines (9 loc) · 502 Bytes

Echo Middleware

The echomw middleware is a mock middleware. It doesn't actually call fetch(), instead it copies the incoming request directly to a response. It doesn't call next(), so any other middleware is skipped.

The echomw middleware is only useful for testing purposes and should never be used in production.

Usage

import * as metro from '@muze-nl/metro'
import echomw from '@muze-nl/metro/src/mw/echo.mock.mjs'

const client = metro.client().with( echomw() )