feat(server): return header with salix-version
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2022-06-10 14:07:31 +02:00
parent 2f082ece34
commit 40f0d6892c
3 changed files with 12 additions and 2 deletions

View File

@ -31,7 +31,8 @@
"loopback#token": {} "loopback#token": {}
}, },
"auth:after": { "auth:after": {
"./middleware/current-user": {} "./middleware/current-user": {},
"./middleware/salix-version": {}
}, },
"parse": { "parse": {
"body-parser#json":{} "body-parser#json":{}

View File

@ -0,0 +1,9 @@
module.exports = function(options) {
return function(req, res, next) {
const packageJson = require('../../../package.json');
res.header('Salix-Version', packageJson.version);
next();
};
};

View File

@ -1,6 +1,6 @@
{ {
"name": "salix-back", "name": "salix-back",
"version": "1.0.0", "version": "6.8.0",
"author": "Verdnatura Levante SL", "author": "Verdnatura Levante SL",
"description": "Salix backend", "description": "Salix backend",
"license": "GPL-3.0", "license": "GPL-3.0",