Hey guys i am a noob who has just started working on nodejs . I am developing a web application on nodejs using compoundjs.
This is the structure of my view folder
views/
|-- admin
| |-- games
| |-- squadplayertypes
| `-- toursection
| |-- tourformats
| |-- tourmatchtypes
| `-- tours
|-- layouts
| |-- admin
| | `-- toursection
I have created a name space to handle all requests that are directed to "/admin".
Now I want to know if there is away where I can define a common layout for all the routes inside the namespace "admin".
This is how i have written my routes.js
admin.namespace('toursection', function(toursection){
toursection.resources('tours',function(tour){
tour.post('fetchTourDetails','tours#fetchTourDetails',{collection:true});
});
toursection.resources('tourmatchtypes');
toursection.resources('tourformats');
});
/*Routes for squad players and all related dependancies*/
admin.resources('squadplayers');