Skip to content

Instantly share code, notes, and snippets.

@davglass
Created March 12, 2011 21:06
Show Gist options
  • Save davglass/867559 to your computer and use it in GitHub Desktop.
Save davglass/867559 to your computer and use it in GitHub Desktop.
module.exports = {
bar: function() {
return 'Return from bar::bar()'
}
}
module.exports = {
foo: 'bar'
}
var bar = require('./bar');
module.exports = {
foo: function() {
return 'FOO from ./lib :: ' + bar.bar();
}
}
Hello World
App (davglass) is running (28306)
FOO from ./lib :: Return from bar::bar()
Config::foo: bar
require.paths.push('./lib');
var foo = require('foo.js');
var config = require('./config');
console.log(config);
var app = require('http').createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('Hello World<br>App (davglass) is running (' + process.pid + ')<br>' + foo.foo() + '<br>Config::foo: ' + config.foo);
});
app.listen(5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment