so i an have express server, and i want to use data that I get outside of post function or in other post functions here is the code
app.post('/bg-login', (req, res) => {
            var user;
            req.body.email;
            req.body.password;
            var email1 = req.body.email;
            const path = './Databases/User/' + email1 + '.json';
            if (fs.existsSync(path)) {
                try {
                    // Note that jsonString will be a <Buffer> since we did not specify an
                    // encoding type for the file. But it'll still work because JSON.parse() will
                    // use <Buffer>.toString().
                } catch (err) {
                    return;
                }
                var user1 = fs.readFileSync('./Databases/User/1.json');
                var user = JSON.parse(user1)
            } else {
                res.redirect("/login-e1");
            }
            console.log(user);
Error: user is not defined, so how could I get this variable ( user) to work outside POST function
 
     
    