1.1.0 • Published 6 years ago

koa-response-injection v1.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
6 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

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago