salix/loopback/server/middleware/salix-version.js

9 lines
219 B
JavaScript

const packageJson = require(`${process.cwd()}/package.json`);
module.exports = function(options) {
return function(req, res, next) {
res.set('Salix-Version', packageJson.version);
next();
};
};