Skip to content

Instantly share code, notes, and snippets.

@mwhooker
Created October 7, 2011 19:32
Show Gist options
  • Save mwhooker/1271167 to your computer and use it in GitHub Desktop.
Save mwhooker/1271167 to your computer and use it in GitHub Desktop.
failing express project
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);
@mwhooker
Copy link
Author

mwhooker commented Oct 7, 2011

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