# Decorator UseBeforeEach

Decorator operation private
Module
import { UseBeforeEach } from "@tsed/platform/platform-middlewares/src/decorators/useBeforeEach"
Source/packages/platform/platform-middlewares/src/decorators/useBeforeEach.ts

# Overview

function UseBeforeEach(...args: any[]): Function;

# Description

Mounts the specified middleware function or functions at the specified path: the middleware function is executed when the base of the requested path matches `path.

@Controller('/')
@UseBeforeEach(Middleware1)  // Called before each endpoint
export class Ctrl {

   @Get('/')
   get() { }
}

1
2
3
4
5
6
7
8

Other topics