Created
October 7, 2011 19:32
-
-
Save mwhooker/1271167 to your computer and use it in GitHub Desktop.
failing express project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
var app = express.createServer(); | |
app.get('/pass', function(req, res){ | |
res.send({foo: 'bar'}); | |
}); | |
app.get('/fail', function(req, res){ | |
res.contentType('application/json'); | |
res.send(1, {}, 200); | |
}); | |
app.listen(3000); |
thanks for the quick response.
perhaps I need to upgrade:
TypeError: Object #<ServerResponse> has no method 'json'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for explicit JSON.stringify() stuff use
res.json(1)
, for non-object/arrays that is