- Remove
typeorm
andtypeorm-di
dependencies useExpressServer
require to passContainer
fromtypedi
for injecting the service.
@Use
decorator (middleware) support class and method levels. using@Use
in the class, it will be applied the all class's methods.- The order will apply on the class first, then the method
- Remove
Reflect-metadata
for collecting class or function metadata from the decorators, using the global variables instead (getMetadataArgsStore()
) - For Express middleware, rename the decorator from
@Middleware
to@Use
- Remove
addExpressServer
, please useuseExpressServer
instead.
-
Support dependency injection for the providers, using the module for controlling the controller and provider. (commit link)
Previously
const app = Express(); addExpressController(app, [UserController, IndexController]);
Added providers
const app = Express(); useExpressServer(app, [UserModule, IndexModule]);
// UserModule.ts @Module({ controllers: [UserController], providers: [UserService] }) export class UserModule {} // IndexModule.ts @Module({ controllers: [IndexController], providers: [IndexService] }) export class IndexModule {}
-
Http Method & Middleware can swapable (commit link)
@Get('/') @Middleware(validate)
or
@Middleware(validate) @Get('/')