@universal-packages/express-controllers-parameters
TypeScript icon, indicating that this package has built-in type declarations

1.2.6 • Public • Published

Express controllers parameters

npm version Testing codecov

Express parameters for universal controllers.

Install

npm install @universal-packages/express-controllers-parameters

npm install express
npm install @universal-packages/express-controllers

Global middleware

By installing this package a global middleware is going to be loaded automatically by the ExpressControllers.

Global methods

setUnionKind(unionKind: string)

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')

Hooks

@UseParameters([unionKind: string])

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
  }
}

Typescript

This library is developed in TypeScript and shipped fully typed.

Contributing

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.

License

MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i @universal-packages/express-controllers-parameters

Weekly Downloads

506

Version

1.2.6

License

MIT

Unpacked Size

11.1 kB

Total Files

18

Last publish

Collaborators

  • omarandstuff