0.1.1 • Published 8 years ago

koalesce-mw-response-types v0.1.1

Weekly downloads
1
License
ISC
Repository
github
Last release
8 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

8 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago