Skip to content

Commit

Permalink
fix: Pass down host, port and insecure options to clients
Browse files Browse the repository at this point in the history
  • Loading branch information
trodrigues committed Jun 21, 2016
1 parent 065c601 commit 909d2ae
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/utils/create-clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,30 @@ export default function createClients (opts) {
if (opts.sourceDeliveryToken) {
clients.source.delivery = contentful.createClient({
space: opts.sourceSpace,
accessToken: opts.sourceDeliveryToken
accessToken: opts.sourceDeliveryToken,
host: opts.deliveryHost,
port: opts.deliveryPort,
insecure: opts.deliveryInsecure
})
}

if (opts.sourceManagementToken) {
clients.source.management = contentfulManagement.createClient({
accessToken: opts.sourceManagementToken
accessToken: opts.sourceManagementToken,
host: opts.managementHost,
port: opts.managementPort,
insecure: opts.managementInsecure
})
}

if (opts.destinationSpace) {
clients.destination = {
spaceId: opts.destinationSpace,
management: contentfulManagement.createClient({
accessToken: opts.destinationManagementToken
accessToken: opts.destinationManagementToken,
host: opts.managementHost,
port: opts.managementPort,
insecure: opts.managementInsecure
})
}
}
Expand Down

0 comments on commit 909d2ae

Please sign in to comment.