Created
March 12, 2011 21:06
-
-
Save davglass/867559 to your computer and use it in GitHub Desktop.
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
module.exports = { | |
bar: function() { | |
return 'Return from bar::bar()' | |
} | |
} |
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
module.exports = { | |
foo: 'bar' | |
} |
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 bar = require('./bar'); | |
module.exports = { | |
foo: function() { | |
return 'FOO from ./lib :: ' + bar.bar(); | |
} | |
} |
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
Hello World | |
App (davglass) is running (28306) | |
FOO from ./lib :: Return from bar::bar() | |
Config::foo: bar |
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
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