@kever/response
TypeScript icon, indicating that this package has built-in type declarations

1.2.4 • Public • Published

@kever/response

a kever property plugin, standard response output format.

Install

npm install @kever/response --save

Start

//index.ts
import { createApp } from '@kever/core'

createApp({
  port: 9000,
  plugins: [
    '@kever/response'
  ]
})
// controller.ts
import { BaseController, Context, Controller } from '@kever/core'
import { PluginType, UsePlugin } from '@kever/ioc'
import { Get } from '@kever/router'
import { Response } from '@kever/response'

@Controller('/')
export class Controller extends BaseController {

  @UsePlugin(PluginType.property, 'response')
  private response: Response

  @Get('/index')
  async index(ctx: Context) {

    ctx.body = this.response(ctx, 10000, {
      name: 'kever',
      message: 'Hello world'
    })
  }
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.40latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.40
1.2.21
1.1.60
1.1.30
1.1.20
1.1.10
1.1.00
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i @kever/response

Weekly Downloads

1

Version

1.2.4

License

MIT

Unpacked Size

7.54 kB

Total Files

7

Last publish

Collaborators

  • hubvue