Skip to content

Instantly share code, notes, and snippets.

@3rd-Eden
Created August 27, 2010 20:06
Show Gist options
  • Save 3rd-Eden/554091 to your computer and use it in GitHub Desktop.
Save 3rd-Eden/554091 to your computer and use it in GitHub Desktop.
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 );
});
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;
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