UNPKG

ea-crm-service-connector

Version:

A connector for Microsoft Dynamics CRM instances

23 lines (20 loc) 569 B
'use strict' const dnscache = require('dnscache')({ 'enable': true, 'ttl': 300, 'cachesize': 1000 }) const configHelper = require('../helpers/config-helper') const crmConfig = configHelper.getCrmConfig() module.exports = { setup: function (callback) { let host = crmConfig.dynamics.oauth.resource host = host.replace(/(https?:\/\/)?([^:^/]*)(:\\d*)?(.*)?/, '$2') // get the host part from the url dnscache.lookup(host, function (err, result) { if (err) { return callback(err) } return callback(null, result) }) } }