node-decorators
post(@Params('id', (id) => !IsNaN(Number(id))) id: number) {}
Resolves #183
@decorators/di
to 3.1.0
with support of root containerInjectable
options with providedIn='root'
option in it to register root provider.RootContainer
is exported out of di
package.adapter.IsHeadersSent
- returns now boolean*
)1.0.0-beta.4 release:
render
process (#173, #175)undefined
instead of null
so default values can be usedFixed missing typeVersions and exports in package.json
Features:
Package is router library agnostic so it's possible to use express
, fastify
or koa
.
In this release only ExpressAdapter is included, more to come.
Reimagined middleware. Supports both running code before and after main handler.
There are three types of pipes: global
, controller
and method
at the moment.
Order of Execution:
Global => Controller => Method => Route Handler => Method => Controller => Global
Based on class-validator and class-transformer system supports payload validation. Standard type validation (i.e. string
, object
, boolean
etc.) is also supported.
@Post('', 200)
create(@Body() post: PostType) {
return post;
}
@Get(':id', 200)
post(@Params('id') id: string) {
return { id, name: 'hello world' };
}
Modules keep providers scoped. Resolved via update of @decorators/[email protected]
version that supports nesting of containers. With 3.0.0 update is also possible to use multi
providers (available through the same injection token).