1.2.4 • Published 9 months ago

@kever/response v1.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@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'
    })
  }
}
1.2.4

9 months ago

1.2.2

9 months ago

1.1.6

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago