Proof of Concept of Running React PHP in aws lambda server
A proof of concept on how to run React-PHP on a serverless application at AWS Lambda service using Bref.
- AWS Console with configured access keys.
- Serverless Framework
- PHP 7.4.3 or greater
If Node express can run natively in aws lambda, why not run React-PHP?
- Execute an Async PSR-7 Request Handler from PSR-11 container
- Execute an Async callable class from PSR-11 container
- Execute an Async Bref\Context\Context\Handler from PSR-11 container
- Execute an Async PSr-7 Request Handler without container
- Execute an Async Bref\Context\Context\Handler without container
- Execute an Async anonymous function from file
- Execute complete async Application like DriftPHP from a unique API Gateway entry-point
- Check Interest in Bref project to add React-php handler
- Learn how to deploy React-PHP-FPM 7.4 layer
- WyriHaximus, and clue for making React-PHP, adding a complete new paradigm to PHP.
- mnapoli For making Bref, opening a new world of possibilities for PHP on cloud.
- mmoreram For giving us he's perspective.
- Use Bref PHP-FPM 7.4 Layer
- We add a custom bootstrap file using a React PHP event loop instead of the "while=true" loop given by default Bref bootstrap.
- The given handler is managed with promises by the ReactHandler class
- We replace the LambdaRuntime class by ReactRuntime
git clone git@github.com:kpicaza/react-php-lambda.git dev
cd dev
composer install --prefer-dist --optimize-autoloader --no-dev
sls deploy # serverless deploy
sls remove # serverless remove
Using Antidot Framework application's container, event dispatcher, and Request handler returning promises.