Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
byjg committed Apr 11, 2019
1 parent 88b9260 commit 10a64a4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions web/README.md
@@ -0,0 +1,23 @@
# Examples

## Basic API

```
php -S localhost:8080 app-dist.php
```

Endpoints

- GET /test
- GET /testclosure

## Basic Swagger

```
php -S localhost:8080 app-swagger.php
```

Endpoints

- GET /test
- GET /testclosure
4 changes: 2 additions & 2 deletions web/app-dist.php
Expand Up @@ -23,7 +23,7 @@
'GET',
'/testclosure',
\ByJG\RestServer\HandleOutput\JsonHandler::class,
function ($request, $response) {
function ($response, $request) {
$response->write('OK');
}
));
Expand All @@ -39,7 +39,7 @@ function ($request, $response) {
*/
class ClassName
{
public function someMethod($request, $response)
public function someMethod($response, $request)
{
$response->write('It worked');
}
Expand Down

0 comments on commit 10a64a4

Please sign in to comment.