use text/plain content-type

Sean Lavine 2014-04-23 17:16:37 -07:00
parent 1a41ab45fa
commit 54e92da4a7

@ -19,11 +19,11 @@ var server = http.createServer(function(req, res) {
// An error occurred, remove the client from the connection pool.
// A truthy value passed to done will remove the connection from the pool
// instead of simply returning it to be re-used.
// In this case, if we have successfully, received a client (truthy)
// instead of simply returning it to be reused.
// In this case, if we have successfully received a client (truthy)
// then it will be removed from the pool.
done(client);
res.writeHead(500, {'content-type': 'text/html'});
res.writeHead(500, {'content-type': 'text/plain'});
res.end('An error occurred');
return true;
};
@ -40,9 +40,9 @@ var server = http.createServer(function(req, res) {
// handle an error from the query
if(handleError(err)) return;
// return the client to the connection pool for other requests to use
// return the client to the connection pool for other requests to reuse
done();
res.writeHead(200, {'content-type': 'text/html'});
res.writeHead(200, {'content-type': 'text/plain'});
res.end('You are visitor number ' + result.rows[0].count);
});
});