module.exports = Self => { Self.remoteMethodCtx('getUrl', { description: 'Returns the colling app name', accepts: [ { arg: 'appName', 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; }; };