nestjs-alldata-decorator
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

nestjs-alldata-decorator

When using the "@All" decorator, collect all data

install

$ npm install nestjs-alldata-decorator

Use

import { All, Controller } from '@nestjs/common';
import { AllData } from 'nestjs-alldata-decorator';

@Controller()
export class AppController {
  @All(':p1')
  main(@AllData() data) {
    console.log(data); // { word: 'hello', name: 'ajanuw', p1: 'xxx' }
    return 'hello world';
  }
}
curl --location --request POST 'http://localhost:3000/xxx?word=hello' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'name=ajanuw'

See also:

Readme

Keywords

Package Sidebar

Install

npm i nestjs-alldata-decorator

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

4.6 kB

Total Files

6

Last publish

Collaborators

  • ajanuw