Created
August 27, 2010 20:06
-
-
Save 3rd-Eden/554091 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
var connect = require("connect"), | |
express = require("express"); | |
var app = express.createServer(), | |
routes = require("./routes"); | |
app.configure(function(){ | |
app.set("views", __dirname + "/views"); | |
app.use(app.router); | |
}); | |
app.routes = routes( app, function(){ | |
app.listen( 300 ); | |
}); |
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 mongo = require('mongodb'), | |
db = new mongo.Db( "dataset", new mongo.Server( "localhost", 1234, {} ), {} ); | |
function applicationRouter( app, serverCallback ){ | |
db.open(function(){ | |
app.get("/", function( req, res, next ){ | |
res.writeHead(200, { | |
'Content-Type': 'text/html', | |
}); | |
res.end("Hello world"); | |
}); | |
serverCallback(); | |
}): | |
}; | |
module.exports = applicationRouter; |
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 mongo = require('mongodb'), | |
db = new mongo.Db( "dataset", new mongo.Server( "localhost", 1234, {} ), {} ); | |
function applicationRouter( app, serverCallback ){ | |
app.get("/", function( req, res, next ){ | |
res.writeHead(200, { | |
'Content-Type': 'text/html', | |
}); | |
res.end("Hello world"); | |
}); | |
serverCallback(); | |
}; | |
module.exports = applicationRouter; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment