Skip to content

Instantly share code, notes, and snippets.

@designfrontier
Created December 1, 2015 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save designfrontier/4cdb1e1a4624a4e7eea2 to your computer and use it in GitHub Desktop.
Save designfrontier/4cdb1e1a4624a4e7eea2 to your computer and use it in GitHub Desktop.
return a 500 error for all requests
var http = require('http');
var server = http.createServer(function (req, res) {
console.log(req.url);
if (req.url !== '/api/presence' && req.url !== '/api/heartbeat') {
res.statusCode = 500;
res.end('error');
} else {
res.end('works');
}
});
server.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment