Skip to content

Instantly share code, notes, and snippets.

@gigafied
Created January 7, 2012 03:18
Show Gist options
  • Save gigafied/1573659 to your computer and use it in GitHub Desktop.
Save gigafied/1573659 to your computer and use it in GitHub Desktop.
var app = express.createServer();
app.configure(function(){
app.set('views', this.root_dir + "/" + this.template_dir);
app.set('view engine', this.template_engine);
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(this.root_dir + "/" + this.static_dir));
});
app.listen(this.port);
console.log(this.root_dir + "/" + this.template_dir);
console.log(app);
OUTPUTS:
/Users/taka.kojima/Projects/express-box/templates
{ stack:
[ { route: '', handle: [Function] },
{ route: '', handle: [Function: bodyParser] },
{ route: '', handle: [Function: methodOverride] },
{ route: '', handle: [Function] },
{ route: '', handle: [Function: static] } ],
connections: 0,
allowHalfOpen: true,
_handle:
{ writeQueueSize: 0,
onconnection: [Function: onconnection],
socket: [Circular] },
_events:
{ request: [Function],
connection: [Function: connectionListener],
listening: [Function] },
httpAllowHalfOpen: false,
cache: {},
settings: { env: 'null', views: 'undefined/undefined' },
redirects: {},
isCallbacks: {},
_locals:
{ settings: { env: 'null', views: 'undefined/undefined' },
app: [Circular] },
dynamicViewHelpers: {},
errorHandlers: [],
route: '/',
routes:
{ app: [Circular],
routes: {},
params: {},
_params: [],
middleware: [Function] },
router: [Getter],
__usedRouter: true }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment