# ExpressRouter Type alias
Module | import { ExpressRouter } from "@tsed/common" |
---|---|
Source | /packages/common/src/platform-express/decorators/ExpressRouter.ts |
# Overview
type ExpressRouter = Express.Router & {
(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
};
/**
* Inject the ExpressRouter (Express.Router) instance.
*
* ### Example
*
* ```typescript
* import {ExpressRouter, Service} from "@tsed/common";
*
* @Controller("/")
* export default class OtherService {
* constructor(@ExpressRouter router: ExpressRouter) {}
* }
* ```
*
* @param {Type<any>} target
* @param {string} targetKey
* @param {TypedPropertyDescriptor<Function> | number} descriptor
* @returns {any}
* @decorator
* @deprecated Use PlatformRouter instead of.
*/
export function ExpressRouter(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
# Members
(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing