function contentFor(config, match, type, options) {
  let content = [];

  // This normalizes `rootURL` to the value which we use everywhere inside of Ember CLI.
  // This makes sure that the user doesn't have to account for it in application code.
  if ('rootURL' in config) {
    config.rootURL = normalizeUrl(config.rootURL);
  }

  switch (type) {
    case 'head':
      if (options.storeConfigInMeta) {
        content.push(
          `<meta name="${config.modulePrefix}/config/environment" content="${encodeURIComponent(
            JSON.stringify(config)
          )}" />`
        );
      }

      break;
    case 'config-module':
      if (options.storeConfigInMeta) {
        content.push(`var prefix = '${config.modulePrefix}';`);
        content.push(fs.readFileSync(path.join(__dirname, '../broccoli/app-config-from-meta.js')));
      } else {
        content.push(`
          var exports = {
            'default': ${JSON.stringify(config)}
          };
          Object.defineProperty(exports, '__esModule', {value: true});
          return exports;
        `);
      }

      break;
    case 'app-boot':
      if (options.autoRun) {
        let moduleToRequire = `${config.modulePrefix}/app`;
        content.push(`
          if (!runningTests) {
            require("${moduleToRequire}")["default"].create(${convertObjectToString(config.APP)});
          }
        `);
      }

      break;
    case 'test-body-footer':
      content.push(
        `<script>
document.addEventListener('DOMContentLoaded', function() {
  if (!EmberENV.TESTS_FILE_LOADED) {
    throw new Error('The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js".');
  }
});
</script>`
      );

      break;
  }

  content = options.addons.reduce((content, addon) => {
    let addonContent = addon.contentFor ? addon.contentFor(type, config, content) : null;
    if (addonContent) {
      for (const deprecatedType of DEPRECATIONS.V1_ADDON_CONTENT_FOR_TYPES.options.meta.types) {
        deprecate(
          `Addon \`${addon.name}\` is using the deprecated \`${deprecatedType}\` type in its \`contentFor\` method. Please see the deprecation guide for the correct path forward.`,
          type !== deprecatedType,
          DEPRECATIONS.V1_ADDON_CONTENT_FOR_TYPES.options
        );
      }

      return content.concat(addonContent);
    }

    return content;
  }, content);

  return content.join('\n');
}
Returns the content for a specific type (section) for index.html.

```
{{content-for "[type]"}}
```

Supported types:

- 'head'
- 'config-module'
- 'head-footer'
- 'test-header-footer'
- 'body-footer'
- 'test-body-footer'

@method contentFor
@param {Object} config Ember.js application configuration
@param {RegExp} match Regular expression to match against
@param {String} type Type of content
@param {Object} options Settings that control the default content
@param {Boolean} options.autoRun Controls whether to bootstrap the
                    application or not
@param {Boolean} options.storeConfigInMeta Controls whether to include the
                    contents of config
@return {String} The content.