0.1.1 • Published 9 years ago

koalesce-mw-response-types v0.1.1

Weekly downloads
1
License
ISC
Repository
github
Last release
9 years ago

Response Content Type Middleware for Koalesce

This module is Koalesce middleware that sets the response content type for a route and validates the output. Output validation is ususally restricted to the dev and test environments.

If that sentence doesn't mean anything to you, you can always start here: koalesce-starter. (A working starter app built using angular, koa, node, and mongo.)

Route Fields

The response types middleware checks for the responseContentType field on a route. This field can be any of the following types:

  • text
  • html
  • json
  • file

Full example:

routes: {
	example: {
		url: '/route',
		method: 'POST',
		responseContentType: 'json',
		handler: function* () {
		    console.log('done');
		}
	}
}

Other examples:

responseContentType: 'html'
responseContentType: 'file'

Koalesce Middleware Metadata

There is no metadata for this module.

Configuration Options

There are no configuration options.

0.1.1

9 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago