I have a created routes and calling some functions in expressjs. This function is properly getting executing and retuning data.
exports.index = function (req, res) {
Data.find({
parent: null
}, function (err, employee) {
if (err) {
return handleError(res, err);
}
return res.status(200).json(employee);
});
};
I want to log some message on console when system executes this function. if i use console.log('some message'), I do not see anything on console & if I use alert, I get following error message.
ReferenceError: alert is not defined<br> at exports.index
How can I log messages on chrome console while working with expressjs.
This is a server site javascript so you need to look at the nodejs console.