Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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); } });



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: