var atYourService = function (req, res, next) { var filepath = path.join(__dirname, 'foobar.txt') fs.readFile(filepath, function (err, data) { if (err) next() res.send(data) }) } module.exports = atYourService