Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jblanche/8710710 to your computer and use it in GitHub Desktop.
Save jblanche/8710710 to your computer and use it in GitHub Desktop.
function readContent(callback) {
fs.readFile("./tmp/tmp.log", function (err, content) {
if (err) return callback(err);
callback(null, content);
})
}
exports.index = function(req, res){
readContent(function(err, fileContent){
res.render('index', {
title: 'Express',
content: fileContent
});
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment