Answers.Body: <p>Craft config files usually allow to return environment-specific arrays. So you could just configure different endpoints like so:</p>
  
  <pre class="lang-php prettyprint-override"><code>return [
      '*' =&gt; [],
      '.com' =&gt; [
          'endpoints' =&gt; [
              'api/example&lt;ext:(.json)?&gt;' =&gt; function() {
                  // example API config for live environment
              },
          ],
      ],
      '.dev' =&gt; [
          'endpoints' =&gt; [
              'api/example&lt;ext:(.json)?&gt;' =&gt; function() {
                  // example API config for dev environment
              },
          ],
      ],
  ];
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-14T16:23:50.137Z
Answers.LastActivityDate: 2016-12-14T16:23:50.137Z
Answers.UserDisplayName: carlcs
Answers.Body: <p>Doh so the answer is PHP constants:</p>
  
  <pre><code>define('CRAFT_CONFIG_PATH', '../../craftdev/config/');
  </code></pre>
  
  <p>useful to know.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-15T09:17:21.423Z
Answers.Text: That'll change the path for _all_ your config files (including `db.php`, `general.php` and Redactor configs), though.
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-14T15:53:48.040Z
Answers.LastActivityDate: 2016-12-14T15:53:48.040Z
Answers.UserDisplayName: joomkit
Body: <p>Is it possible to have a dev version path for the Element API plugin so we can keep live and dev API separated?</p>
  
Tags: <plugin-elementapi>
Title: Separate path for Element API plugin
ThreadText: # Separate path for Element API plugin
  
  (Asked by: username_0 on 2016-12-14)
  
  Is it possible to have a dev version path for the Element API plugin so we can keep live and dev API separated?
  
  **Tags:** plugin-elementapi
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-12-14. Score: 2
  
  Craft config files usually allow to return environment-specific arrays. So you could just configure different endpoints like so:
  
  ```php
  return [
      '*' => [],
      '.com' => [
          'endpoints' => [
              'api/example<ext:(.json)?>' => function() {
                  // example API config for live environment
              },
          ],
      ],
      '.dev' => [
          'endpoints' => [
              'api/example<ext:(.json)?>' => function() {
                  // example API config for dev environment
              },
          ],
      ],
  ];
  
  ```
  
  
  ---
  
  ### Answer by username_0 on 2016-12-14. Score: 1
  
  Doh so the answer is PHP constants:
  
  ```
  define('CRAFT_CONFIG_PATH', '../../craftdev/config/');
  
  ```
  
  useful to know.
  
  > **Comments:**
  > **username_2**: That'll change the path for _all_ your config files (including `db.php`, `general.php` and Redactor configs), though.  
  
  ---
  
  