Created
December 1, 2015 18:59
-
-
Save designfrontier/4cdb1e1a4624a4e7eea2 to your computer and use it in GitHub Desktop.
return a 500 error for all requests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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