Comments (6)
Ok @acveer , I will check this out later today and get back to you shortly.
from generator-mongoose.
'var app_routes = app._router.stack' get us the routes fine, but routes have JSON 'handle' collection. I could not figure out how to get the routes for GET, POST, etc from 'app_routes'.
from generator-mongoose.
@afj176 I have fixed this issue locally. This is a very minor issue for getting the app routes correct for default index page. Updating the /routes/index.js as below will get the routes fine on index page. Thank you @arvindr21, I have used slush-mongo as reference to understand this issue.
module.exports = function(app) {
var route = {};
// index.html
route.index = function (req, res) {
/** Code to get the list of routes**/
var app_routes = app._router.stack;
var routes = [];
for (var i = 0; i < app_routes.length; i++) {
var appRoute = app_routes[i].route;
if((typeof appRoute != 'undefined')){
routes.push({
path : appRoute.path,
method : appRoute.stack[0].method
});
}
};
res.render('index', {locals: { routes: routes }});
};
app.get('/', route.index);
};
from generator-mongoose.
@acveer Thanks much for the solution. If you wish you can submit a pull request on this. We would be happy to accept it.
from generator-mongoose.
Yes. Would be happy to do it .
On Wednesday, August 13, 2014, Arvind Ravulavaru [email protected]
wrote:
@acveer https://github.com/acveer Thanks much for the solution. If you
wish you can submit a pull request on this. We would be happy to accept it.—
Reply to this email directly or view it on GitHub
#10 (comment)
.
from generator-mongoose.
installed [email protected] & tested default project page. Default index page opens all app routes. Issue resolved.
from generator-mongoose.
Related Issues (12)
- Configurable sub-generator? HOT 4
- Update package dependencies
- Sub Generator Failing Tests in Travis HOT 1
- Cannot call method 'slugify' of undefined HOT 4
- Version 0.0.5 will not install on a clean windows install due to "latest" on yo dependency
- Errors upon when generating HOT 8
- Travis build failing because of path HOT 4
- undefined exception occurring when grunt is run
- TypeError: Cannot read property 'Base' of undefined
- Storing nested object? HOT 2
- Gruntfile.js error: Error: Running "watch" task Waiting... Warning: watch ENOSPC HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator-mongoose.