0.0.5 • Published 7 years ago

spirit-error v0.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Spirit Error

Easily Return HTTP Errors from Spirit

Supports JSON, HTML, Text and dynamic errors.

Slack Build Status Coverage Status NPM Downloads NPM Dependencies

Usage

import spiritError from 'spirit-error'

// tell spirit-error to create JSON responses
const error = spiritError({
	type: 'json' // default
})

// inside a spirit function
return error.notFound

Returns this HTTP response:

HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
	"error": {
		"message": "Not Found"
	}
}

Install

With npm installed, run

npm install --save spirit-error

or use yarn:

yarn add spirit-error

See Also

License

MIT

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago