| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
| Key | Value |
|---|---|
| Services | Lambda, API Gateway |
| Integrations | AWS CDK, Bref, PHP |
| Categories | Serverless; PHP |
A PHP/Bref serverless application using a shared Lambda layer deployable with AWS CDK to LocalStack. The application implements a typed PHP Lambda handler as an HTTP handler class for serving API Gateway HTTP events. Bref turns API Gateway events into PSR-7 requests for PHP processing.
make checkmake installexport LOCALSTACK_AUTH_TOKEN=<your-auth-token>
make startmake runThe script bootstraps and deploys the CDK app locally, then invokes the HTTP endpoint via curl. You should see output similar to:
Outputs: CdkBrefStack.Url = https://bd0f6b19.execute-api.localhost.localstack.cloud:4566/ Stack ARN: arn:aws:cloudformation:us-east-1:000000000000:stack/CdkBrefStack/dec480c5 ✨ Total time: 7.9s CDK app successfully deployed. Now trying to invoke the Lambda through API gateway. endpoint=https://bd0f6b19.execute-api.localhost.localstack.cloud:4566/ Hello LocalStack!
Bref also supports running web applications on AWS Lambda via php-fpm, enabling traditional PHP frameworks like Laravel and Symfony. To deploy a php-fpm Laravel project from brefphp/examples to LocalStack:
Install the serverless-localstack plugin:
npm install --save-dev serverless-localstackAdd serverless-localstack to plugins in serverless.yml:
plugins:
- ./vendor/bref/bref
- serverless-localstackAdd custom properties:
custom:
localstack:
stages:
- localDeploy:
serverless deploy --stage localThis code is available under the Apache 2.0 license.
| Back | FazBrowse Home | New Git URL |