module.exports = Self => { Self.remoteMethod('getUrl', { description: 'Returns the colling app name', accessType: 'READ', accepts: [ { arg: 'app', type: 'string', required: false } ], returns: { type: 'object', root: true }, http: { path: `/getUrl`, verb: 'get' } }); Self.getUrl = async(appName = 'salix') => { const {url} = await Self.app.models.Url.findOne({ where: { appName, enviroment: process.env.NODE_ENV || 'development' } }); return url; }; };