http-svc
Version:
A HTTP request service for browser and node.js
19 lines (15 loc) • 490 B
text/typescript
import { HttpSvcMiddleware } from '@http-svc/middleware'
import { IMiddlewareHandler } from 'types/exports'
import { getBuiltInMiddlewareName } from '../shared'
interface ILogPayload {
span?: any
}
const log: IMiddlewareHandler<ILogPayload> = async function (_ctx, next, _config) {
console.log('log middleware')
return await next()
}
export class HttpSvcLog extends HttpSvcMiddleware<ILogPayload> {
static handler = log
name = getBuiltInMiddlewareName('LOG')
handler = log
}