Skip to content

Instantly share code, notes, and snippets.

View thepatrick's full-sized avatar
🌈
Hi

Patrick Quinn-Graham thepatrick

🌈
Hi
View GitHub Profile
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();
});
});
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"
});
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