If you want to have bookie defined in the routes require you should pass the bookie like this:
var routes = require("./routes")(bookie);
This is because in Node, The top-level scope is not the global scope; var something inside a Node module will be local to that module.