Break-up Element API Config into partials I'm working on a Vue SPA (single page application) for a client and my ElementAPI config file has grown to be quite large.  To make it easier to maintain I was looking for suggestions of how to have each endpoint in its own file.

Any feedback is appreciated!
I had sometime to review the documentation in more depth;
https://github.com/craftcms/element-api/tree/v1#transformer

An abbreviated example below. Note, I include all transformers in a /transformers directory within /config.

file - craft/config/elementapi.php
    

  return [
    'endpoints' =&gt; [
      // Home
      //
      'api/home' =&gt; function() {
        require craft()-&gt;path-&gt;getConfigPath().'transformers/home.php';
        return [
          'elementType' =&gt; ElementType::Entry,
          'criteria' =&gt; [
            'section' =&gt; 'homepage'
          ],
          'first' =&gt; true,
          'cache' =&gt; 'PT1M',
          'transformer' =&gt; new homeAPI(),
        ];
      },

      // About
      //
      'api/about' =&gt; function() {
        require craft()-&gt;path-&gt;getConfigPath().'transformers/about.php';
        return [
          'elementType' =&gt; ElementType::Entry,
          'criteria' =&gt; [
            'section' =&gt; 'about'
          ],
          'first' =&gt; true,
          'transformer' =&gt; new aboutAPI(),
        ];
      },

      // Remaining Endpoints...
      // 
    ]
  ];
?&gt;


file - craft/config/transformers/home.php

&lt;?php
  namespace Craft;
  require craft()-&gt;path-&gt;getPluginsPath().'elementapi/vendor/autoload.php';
  use League\Fractal\TransformerAbstract;

  class homeAPI extends TransformerAbstract {
    public function transform(EntryModel $entry) {

      $bodyBlocks = [];
      foreach ($entry-&gt;homepageContent as $block) {
        switch ($block-&gt;type-&gt;handle) {
          case 'gallery':

            $bodyBlocks[] = [
              'gallery' =&gt; [
                'thumbnails' =&gt; $thumbnails
              ]
            ];
          break;

          // Remaining Fields...
          //
        }
      }

      return [
        'id' =&gt; (integer) $entry-&gt;id,
        'title' =&gt; $entry-&gt;title,
        'content' =&gt; $bodyBlocks,
      ];
    }
  }