File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,27 @@ to serverless.yml
144
144
functions:
145
145
app:
146
146
- handler: public/index.php
147
- + handler: public/index.php:App\Service\MyHandler
147
+ + handler: public/index.php:App\Lambda\MyLambda
148
+ ```
149
+
150
+ #### Invoke handlers locally
151
+
152
+ Using a service from the container makes the handlers very simple to unit test.
153
+ However, if you are lazy, you may want to invoke them locally from CLI.
154
+
155
+ Run the following command to invoke the ` App\Lambda\MyLambda ` service.
156
+
157
+ ``` cli
158
+ ./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\MyLambda
159
+ ```
160
+
161
+ If your service expects some event data, add it as a JSON string or a path to a
162
+ file containing JSON.
163
+
164
+ ``` cli
165
+ ./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\MyLambda '{"foo":"bar"}'
166
+
167
+ ./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\MyLambda example/input.json
148
168
```
149
169
150
170
### Console application
You can’t perform that action at this time.
0 commit comments