# OverrideMiddleware Decorator

Module
import { OverrideMiddleware } from "@tsed/common"
Source/packages/common/src/mvc/decorators/class/overrideMiddleware.ts

# Overview

const OverrideMiddleware: typeof OverrideProvider;

# Description

Override a middleware which is already registered in MiddlewareRegistry.

# Usage

import {OriginalMiddlware, OverrideMiddleware} from "@tsed/common";

@OverrideMiddleware(OriginalMiddlware)
export class CustomMiddleware extends OriginalMiddlware {
  public use() {

  }
}
1
2
3
4
5
6
7
8

# Override examples

  • Usage
  • Send response
  • Authentication
  • Response view
  • Global error handler