mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
use text/plain content-type
parent
1a41ab45fa
commit
54e92da4a7
10
Example.md
10
Example.md
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user