How can I force a 504
error in Chrome?
We have a node app that we occasionally get a 504
error from and I wanted do some error handling for 504
errors.
How can I force a 504
error in Chrome?
We have a node app that we occasionally get a 504
error from and I wanted do some error handling for 504
errors.
Copy this into a file called server.js then run node server.js
. If you visit http://localhost:8080
you will be thrown a 504 error.
var http = require('http');
var fs = require('fs');
http.createServer(function (req, res) {
console.log("Sending 504 error to client");
res.writeHead(504, {'Content-Type': 'text/plain'});
res.end();
}).listen(8080);
console.log("Server started on port 8080");