I have a function to get a user profile.
app.get('/api/user/profile', function (request, response) { // Create the default error container var error = new Error(); var User = db.User; User.find({ where: { emailAddress: request.user.username} }).then(function(user) { if(!user) { error.status = 500; error.message = "ERROR_INVALID_USER"; error.code = 301; return next(error); } // Build the profile from the user object profile = { "firstName": user.firstName, "lastName": user.lastName, "emailAddress": user.emailAddress } response.status(200).send(profile); }); });
When the find function is called, it displays the select statement on the console on which the server was started.
Executing (default): SELECT `id`, `firstName`, `lastName`, `emailAddress`, `password`, `passwordRecoveryToken`, `passwordRecoveryTokenExpire`, `createdAt`, `updatedAt` FROM `Users` AS `User` WHERE `User`.`emailAddress` = 'johndoe@doe.com' LIMIT 1;
Is there any way to prevent this from showing up? Some flag that I set somewhere in the configuration file?
thenetimp Mar 08 '15 at 14:56 2015-03-08 14:56
source share