Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/bref/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,27 @@ to serverless.yml
functions:
app:
- handler: public/index.php
+ handler: public/index.php:App\Service\MyHandler
+ handler: public/index.php:App\Lambda\MyLambda
```

#### Invoke handlers locally

Using a service from the container makes the handlers very simple to unit test.
However, if you are lazy, you may want to invoke them locally from CLI.

Run the following command to invoke the `App\Lambda\MyLambda` service.

```cli
./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\MyLambda
```

If your service expects some event data, add it as a JSON string or a path to a
file containing JSON.

```cli
./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\MyLambda '{"foo":"bar"}'

./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\MyLambda example/input.json
```

### Console application
Expand Down