Skip to content

Interceptor

Pavel Koch edited this page Mar 2, 2019 · 2 revisions

Type Interceptor

import { Interceptor } from 'awi'

This is the type used for all interceptor functions.


(request: Request) => Promise<any>

The heart of Awi - the interceptor type used in every .use call. It takes the current state of the request and the user's callback edits the contents.

Parameters

  • request: Request - The request object to intercept

Returns

Promise<any> - A promise, note that the return value is disregarded


Clone this wiki locally