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 test = require('./helpers'); | |
// Single endpoint: | |
// Connect and check the properties of the connection | |
test(function($) { | |
return $(0).connect().then(function(connection) { | |
$.expect(connection).is.any.connection(); | |
}); | |
}); |
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'); | |
http.createServer(function(req, res){ | |
function giveup(code) { | |
if(code == 410) { | |
res.writeHead(410, { | |
Server: "pfe+redirect", | |
"X-Patrick-Says": "Redirect Engine in just 41 lines of code. node.js rocks" | |
}); |
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 url = require("url"); | |
var requestUrl = require("request"); | |
var port = process.env.PORT || 1856; | |
http.createServer(function(request, response) { | |
// request module works from here |