1.1.0 • Published 4 years ago

koa-response-injection v1.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

Koa Response Injection

Normal function, promise response inject in koa.

Install

$ npm i koa-response-injection

Spec

Convert

injecion.inject(ctx, result, options = {statusCode, response});

Response

function Response({ name, where, options }) {
  this.name = name;
  this.where = where;
  this.options = options;
}
  • This option specifies where the response will be bind to ctx.
  • The default value is body, which binds the request value to the body of the response.
  • Another predefined option is headers, which binds the request value to the headers of the response.
  • Another predefined option is context, which binds the request value to the ctx.
  • Another predefined option is cookies, which binds the request value to the cookies.
  • The other option sets the response to ctx[bind.name].

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago