Giter Club home page Giter Club logo

Comments (6)

afj176 avatar afj176 commented on July 28, 2024

Ok @acveer , I will check this out later today and get back to you shortly.

from generator-mongoose.

acveer avatar acveer commented on July 28, 2024

'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.

acveer avatar acveer commented on July 28, 2024

@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.

arvindr21 avatar arvindr21 commented on July 28, 2024

@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.

acveer avatar acveer commented on July 28, 2024

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.

acveer avatar acveer commented on July 28, 2024

installed [email protected] & tested default project page. Default index page opens all app routes. Issue resolved.

from generator-mongoose.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.