i want to route in multiple files
var routes=require('./routes');
in the routes/index.js
exports.inicio=require('./inicio')
exports.home=require('./home')
in the inicio.js
exports.index=function(req,res){res.render('index/index',{title: 'Bienvenido a Inmoweb'});}
in the home.js
exports.nosotros=function(req, res){res.render('index/nosotros',{title:'Nosotros'});}
when i console.log(routes)
{
inicio: {index:[function]},
home: {nosotros:[function]}
}
so i call in app
app.get('/',routes.inicio.index);
but i want to call like this
app.get('/',routes.index);
app.get('/nosotros',routes.nosotros);
and the console.log supose to be????
{
index:[function],
nosotros:[function]
}
how to do that??? tnx all