#1427 Método rest para comprobar estado de backend
gitea/salix/master This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-05-15 11:53:57 +02:00 committed by Joan Sanchez
parent 307cffcb58
commit 484ba30137
4 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,19 @@
module.exports = Self => {
Self.remoteMethod('status', {
description: 'Gets the backend status',
returns: {
type: 'Object',
root: true
},
http: {
path: `/status`,
verb: 'GET'
}
});
Self.status = async() => {
await Self.rawSql(`SELECT TRUE`);
return true;
};
};

View File

@ -0,0 +1,4 @@
module.exports = function(Self) {
require('../methods/application/status')(Self);
};

View File

@ -0,0 +1,12 @@
{
"name": "Application",
"base": "VnModel",
"acls": [
{
"property": "status",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
}

View File

@ -46,5 +46,8 @@
}, },
"Schema": { "Schema": {
"dataSource": "vn" "dataSource": "vn"
},
"Application": {
"dataSource": "vn"
} }
} }