Express parameters for universal controllers.
npm install @universal-packages/express-controllers-parameters
npm install express
npm install @universal-packages/express-controllers
By installing this package a global middleware is going to be loaded automatically by the ExpressControllers
.
Set up the global middleware parameters union kind by calling this function at any given moment.
import { setUnionKind } from '@universal-packages/express-controllers-parameters'
setUnionKind('join')
Optionally you can set a different strategy for a particular action using this decorator.
import { BaseController, Controller, Get, Post } from '@universal-packages/express-controllers'
import { UseParameters } from '@universal-packages/express-controllers-parameters'
@Controller('good')
export default class GoodController extends BaseController {
@Get()
@UseParameters('separate')
async action() {
this.request.parameters
}
}
This library is developed in TypeScript and shipped fully typed.
The development of this library happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving this library.