| 803 | } |
| 804 | |
| 805 | function createApp (options) { |
| 806 | var app = express() |
| 807 | |
| 808 | app.use(express.urlencoded(options)) |
| 809 | |
| 810 | app.use(function (err, req, res, next) { |
| 811 | res.status(err.status || 500) |
| 812 | res.send(String(req.headers[class="st">'x-error-property'] |
| 813 | ? err[req.headers[class="st">'x-error-property']] |
| 814 | : (class="st">'[' + err.type + class="st">'] ' + err.message))) |
| 815 | }) |
| 816 | |
| 817 | app.post(class="st">'/', function (req, res) { |
| 818 | res.json(req.body) |
| 819 | }) |
| 820 | |
| 821 | return app |
| 822 | } |
| 823 | |
| 824 | function expectKeyCount (count) { |
| 825 | return function (res) { |