typeforce-middleware
v2.1.0
Published
Typeforce, applied as a connect middleware. Strict by default.
Downloads
7
Maintainers
Readme
typeforce-middleware
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)
})