How to use the ember-get-config.contentfulSpace function in ember-get-config

To help you get started, we’ve selected a few ember-get-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github davidpett / ember-data-contentful / addon / adapters / contentful.js View on Github external
_getConfig() {
    let accessToken = config.contentful ? config.contentful.accessToken : config.contentfulAccessToken;
    let api = 'cdn';
    let space = config.contentful ? config.contentful.space : config.contentfulSpace;
    let previewAccessToken = config.contentful ? config.contentful.previewAccessToken : config.contentfulPreviewAccessToken;

    if (config.contentful.usePreviewApi || config.contentfulUsePreviewApi) {
      if (!previewAccessToken) {
        console.warn('You have specified to use the Contentful Preview API; However, no `previewAccessToken` has been specified in config/environment.js'); /* eslint-disable-line no-console */
      } else {
        accessToken = previewAccessToken;
        api = 'preview';
      }
    }
    if (config.contentfulAccessToken || config.contentfulSpace) {
      /* eslint-disable-next-line no-console */
      console.warn(`DEPRECATION: Use of 'contentfulAccessToken' and 'contentfulSpace' will be removed in ember-data-contentful@1.0.0. please migrate to the contentful object syntax:
      contentful: {
        accessToken: '${accessToken}',
        space: '${space}'
github davidpett / ember-data-contentful / addon / adapters / contentful.js View on Github external
_getConfig() {
    let accessToken = config.contentful ? config.contentful.accessToken : config.contentfulAccessToken;
    let api = 'cdn';
    let space = config.contentful ? config.contentful.space : config.contentfulSpace;
    let previewAccessToken = config.contentful ? config.contentful.previewAccessToken : config.contentfulPreviewAccessToken;

    if (config.contentful.usePreviewApi || config.contentfulUsePreviewApi) {
      if (!previewAccessToken) {
        console.warn('You have specified to use the Contentful Preview API; However, no `previewAccessToken` has been specified in config/environment.js'); /* eslint-disable-line no-console */
      } else {
        accessToken = previewAccessToken;
        api = 'preview';
      }
    }
    if (config.contentfulAccessToken || config.contentfulSpace) {
      /* eslint-disable-next-line no-console */
      console.warn(`DEPRECATION: Use of 'contentfulAccessToken' and 'contentfulSpace' will be removed in ember-data-contentful@1.0.0. please migrate to the contentful object syntax:
      contentful: {
        accessToken: '${accessToken}',
        space: '${space}'
      }`);
    }
    return {
      accessToken,
      api,
      space
    };
  }
});