fix: fix application name

This commit is contained in:
Khaled Garbaya
2017-11-07 11:49:31 +01:00
committed by Benedikt Rötsch
parent cf953aa3ad
commit 85d5e0faed

View File

@@ -15,6 +15,7 @@ let previewClient = null
module.exports.initClients = (options) => { module.exports.initClients = (options) => {
// Getting the app version // Getting the app version
const { version } = require('../package.json') const { version } = require('../package.json')
const applicationName = `the-example-app.nodejs/${version}`
const config = options || { const config = options || {
spaceId: process.env.CF_SPACE_ID, spaceId: process.env.CF_SPACE_ID,
@@ -22,12 +23,12 @@ module.exports.initClients = (options) => {
previewToken: process.env.CF_PREVIEW_TOKEN previewToken: process.env.CF_PREVIEW_TOKEN
} }
deliveryClient = createClient({ deliveryClient = createClient({
application: `the-example-app.node/${version}`, application: applicationName,
space: config.spaceId, space: config.spaceId,
accessToken: config.deliveryToken accessToken: config.deliveryToken
}) })
previewClient = createClient({ previewClient = createClient({
application: `the-example-app.node/${version}`, application: applicationName,
space: config.spaceId, space: config.spaceId,
accessToken: config.previewToken, accessToken: config.previewToken,
host: 'preview.contentful.com' host: 'preview.contentful.com'