2.1.0 • Published 6 years ago

typeforce-middleware v2.1.0

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

typeforce-middleware

build status Version

Typeforce applied as a connect middleware. Strictness is enabled by default.

Examples

var express = require('express')
var bodyParser = require('body-parser')
var typeforce = require('typeforce-middleware')
var app = express()

app.post('/comment', bodyParser.json(), typeforce({
	title: 'String',
	content: 'String'
}), function (req, res) {
	res.status(200).end()
}, function (err, req, res, next) {
	res.status(400).end(err.message)
})

LICENSE MIT