title: { "statusCode": 405, "error": { "type": "NOT_ALLOWED", "description": "Method not allowed. Must be one of: OPTIONS" } }
body: <p>Trying to create rest Api using Slim Framework getting this error when I type in browser</p>
  <blockquote>
  <p>http://localhost/filename/public/hello/name</p>
  </blockquote>
  <p>index.php file</p>
  <pre><code>&lt;?php
  use Psr\Http\Message\ResponseInterface as Response;
  use Psr\Http\Message\ServerRequestInterface as Request;
  
  require '../vendor/autoload.php';
  
  $app = new \Slim\App;
  
  $app-&gt;get('/hello/{name}', function (Request $request, Response $response, array $args) {
      $name = $args['name'];
      $response-&gt;getBody()-&gt;write(&quot;Hello, $name&quot;);
      return $response;
  });
  
  $app-&gt;run();
  </code></pre>