title: Slim Framework v3 running on built-in php server
body: <p>I'm working on an application that uses Slim Framework v3 and I'm trying to use the built-in php server to test the code.
  The problem is no matter what I try I still get the stock 404 error message.</p>
  
  <p>I'm running the web server with this command:</p>
  
  <pre><code>php -S localhost:8080 src/routes/api.php
  </code></pre>
  
  <p>And this is my code in api.php</p>
  
  <pre><code>header('Access-Control-Allow-Origin: *');
  header('Access-Control-Allow-Methods: "GET, POST, PUT, PATCH, DELETE, OPTIONS"');
  header('Access-Control-Allow-Headers: Authorization, X-Auth-Token, Content-Type');
  
  require __DIR__ . '/../../vendor/autoload.php';
  
  use \Psr\Http\Message\ServerRequestInterface as Request;
  use \Psr\Http\Message\ResponseInterface as Response;
  
  $settings = [
      'settings' =&gt; [
          'determineRouteBeforeAppMiddleware' =&gt; true,
          'displayErrorDetails' =&gt; true
      ],
  ];
  $app = new Slim\App($settings);
  
  // Dependency injection
  $di_container = $app-&gt;getContainer();
  
  $app-&gt;get('/help', function (Request $request, Response $response, $args) {
      return $response-&gt;withJson(['test']);
  });
  </code></pre>
  
  <p>When I change the /help route in api.php to simply / and then visit any route in the browser I can then see the results of that / route.
  Any ideas?</p>