News for hackers. Stuff that matters.
Re:Ace - Sinatra for Node with Fibers by Judson on Tuesday February 14, 2012 @06:12PM (#3592235)
This project looks really nice, though I really wish there was an easy way to segment routes into multiple files since it seems like an application w/ any kind of complexity would get out of hand quickly.

I didn't see a way by just skimming the docs - is there an easy way?

Re:Ace - Sinatra for Node with Fibers by maccman on Tuesday February 14, 2012 @09:23PM (#3592719)
Yes, the 'app' global will be available in every file you require in.
Re:Ace - Sinatra for Node with Fibers by Skywing on Tuesday February 14, 2012 @10:20PM (#3592852)
Here's an example of my usual pattern, using express: https://github.com/ryancole/node-simple-upload/tree/master/n...

The routes are not namespaced like you'd see with something like Python's Flask does, but it still allows me to group all my similar routes.

Re:Ace - Sinatra for Node with Fibers by furtivefelon on Tuesday February 14, 2012 @07:04PM (#3592379)
this works for me:

include it in routes/index.js, and everything in your routes dir will be exposed if you do var routes = require('./routes')

var files = fs.readdirSync('./routes') files.forEach(function(file){ if(file != 'index.js'){ var exp = require('./'+file); _.extend(exports, exp); } });

Re:Ace - Sinatra for Node with Fibers by weixiyen on Tuesday February 14, 2012 @06:48PM (#3592337)
just write a library that traverses a directory and include the files...