This file contains hidden or 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 fs = require('fs'); | |
var url = require('url'); | |
var sys = require('sys'); | |
var http = require('http'); | |
require('./ejs'); // EJS, http://embeddedjs.com/ | |
/* | |
* Server-side controller methods | |
*/ |
This file contains hidden or 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
[66/67] cxx: src/node_crypto.cc -> build/default/src/node_crypto_5.o | |
../src/node_crypto.cc: In static member function ‘static v8::Handle<v8::Value> node::SecureContext::Init(const v8::Arguments&)’: | |
../src/node_crypto.cc:392: error: invalid conversion from ‘const SSL_METHOD*’ to ‘SSL_METHOD*’ | |
../src/node_crypto.cc:401: error: invalid conversion from ‘const SSL_METHOD*’ to ‘SSL_METHOD*’ | |
../src/node_crypto.cc:403: error: invalid conversion from ‘const SSL_METHOD*’ to ‘SSL_METHOD*’ | |
../src/node_crypto.cc:405: error: invalid conversion from ‘const SSL_METHOD*’ to ‘SSL_METHOD*’ | |
../src/node_crypto.cc:407: error: invalid conversion from ‘const SSL_METHOD*’ to ‘SSL_METHOD*’ | |
../src/node_crypto.cc:409: error: invalid conversion from ‘const SSL_METHOD*’ to ‘SSL_METHOD*’ | |
../src/node_crypto.cc:411: error: invalid conversion from ‘const SSL_METHOD*’ to ‘SSL_METHOD*’ | |
../src/node_crypto.cc:413: error: invalid conversion from ‘const SSL_METHOD*’ to ‘SSL_METHOD*’ |
This file contains hidden or 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
// This is a design doc for adding two methods to node via monkey patching | |
// that I find useful in all the little bits of HTTP glue I make. The point | |
// is to create a useful abstraction for forwarding requests and linking | |
// responses. In the most trivial case for building a reverse proxy, but | |
// see below for other use cases. | |
// API | |
http.ServerRequest.prototype.forward(port, host, dataFilter=null) | |
http.ServerResponse.prototype.attach(requestOrResponse, responseFilter=null, dataFilter=null) |
This file contains hidden or 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
io = require 'socket.io' | |
fs = require 'fs' | |
sys = require 'sys' | |
http = require 'http' | |
path = require 'path' | |
colors = require 'colors' | |
events = require 'events' | |
connect = require 'connect' | |
cs = require './coffee-script/lib/coffee-script' |
This file contains hidden or 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 sys = require('sys'); | |
var path = require('path'); | |
var http = require('http'); | |
http.createServer(function(req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World!\n'); | |
console.log('servi'); | |
}).listen(1337, "localhost"); |
This file contains hidden or 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
express = require("express") | |
app = module.exports = express.createServer() | |
app.configure -> | |
app.use express.bodyParser() | |
app.use app.router | |
ans = | |
tallErStorst: | |
rex: /^(.*)\: hvilket av disse tallene er storst\:\s(.*)/, |
This file contains hidden or 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
function collectData(){ | |
function copy(src, obj, keys){ | |
for(var name, i = 0, len = keys.length; i < len; i++){ | |
name = keys[i]; | |
if(typeof src[name] !== 'undefined'){ | |
if (typeof src[name] === 'function') { // function this and that | |
} else if (typeof src[name] === 'object'){ | |
for(var subkey in src[name]){ obj[name+'_'+subkey] = src[name][subkey]; } | |
} else { | |
obj[name] = src[name]; |
This file contains hidden or 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 readStream = fs.createReadStream(filepath); | |
readStream.on('data', function(data){ | |
console.log('data event', filepath); | |
}); | |
readStream.on('end', function(){ | |
console.log('end event', filepath); | |
// I never get an end event when I use pipe |
This file contains hidden or 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
console.log("console.loggin"); |
This file contains hidden or 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
/Users/sverosak/Code/git/pasties-validator-web/node_modules/hapi/lib/server.js:95 | |
this._loadBench = new Utils.Bench(); | |
^ | |
TypeError: undefined is not a function |
OlderNewer