hmm: Parameter mitgeben beim Express app.get

Beitrag lesen

hm, ich hab das mal so eingebaut:

    this.sendClient = function() {
        var app = this.createApp();
        var port = process.env.port || 8080;
        
        for(var i = 0; i < configJson.routings.length; i++) {
            var file = configJson.routings[i];
            if(file.sessionSite == 0) {
                app.get(file.route, function(req, res) {
                    res.sendfile(file.htmlFileName, { root: __dirname + file.pathToHtmlFile });
                });
            } else {
                app.get(file.route, function(req, res) {
                     "use strict";
                    let x = i;
                    console.log(x);
                    if(req.session.email) {
                        res.sendfile(file.htmlFileName, { root: __dirname + file.pathToHtmlFile });
                    } else {
                        var rootFile = configJson.routings[0];
                        res.sendfile(rootFile.htmlFileName, { root: __dirname + rootFile.pathToHtmlFile });
                    }
                });
            }
        }
        
        app.listen(port);
    }

nur leider ist der log immernoch immer 7. was mache ich falsch?