Skip to content

Taxum / @taxum/core / middleware/trace / TraceLayer

Class: TraceLayer

Defined in: middleware/trace.ts:127

A layer that traces requests and responses.

Example

ts
import { TraceLayer } from "@taxum/core/middleware/trace";
import { m, Router } from "@taxum/core/routing";

const router = new Router()
    .route("/", m.get(() => "Hello World))
    .layer(new TraceLayer());

Implements

Constructors

Constructor

new TraceLayer(): TraceLayer

Returns

TraceLayer

Methods

classifier()

classifier(classifier): this

Defined in: middleware/trace.ts:133

Parameters

classifier

Classifier

Returns

this


layer()

layer(inner): HttpService

Defined in: middleware/trace.ts:153

Wrap the given service with the middleware, returning a new service that has been decorated with the middleware.

Parameters

inner

HttpService

Returns

HttpService

Implementation of

Layer.layer


onFailure()

onFailure(onFailure): this

Defined in: middleware/trace.ts:148

Parameters

onFailure

OnFailure

Returns

this


onRequest()

onRequest(onRequest): this

Defined in: middleware/trace.ts:138

Parameters

onRequest

OnRequest

Returns

this


onResponse()

onResponse(onResponse): this

Defined in: middleware/trace.ts:143

Parameters

onResponse

OnResponse

Returns

this