Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit

Permalink
Update the exmaple code
Browse files Browse the repository at this point in the history
  • Loading branch information
usox committed Feb 23, 2022
1 parent 248bb13 commit 04bb0bd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions example/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

declare(strict_types=1);

use Laminas\Diactoros\ResponseFactory;
use Psr\Http\Message\ServerRequestInterface;
use Usox\JsonSchemaApi\Contract\ApiMethodInterface;
use Usox\JsonSchemaApi\Contract\MethodProviderInterface;
Expand Down Expand Up @@ -63,17 +62,10 @@ public function lookup(string $methodName): ?ApiMethodInterface
);


$endpoint = Endpoint::factory(
$methodContainer
);
$response = $endpoint->serve(
$request,
(new ResponseFactory())->createResponse()
);

// Create the endpoint and retrieve the response
$response = Endpoint::factory($methodContainer)->serve($request);

// Just boilerplate code. Any framework (like slim) will to that for you

$statusLine = sprintf(
'HTTP/%s %s %s',
$response->getProtocolVersion(),
Expand Down

0 comments on commit 04bb0bd

Please sign in to comment.