Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.
Once everything is installed, you can now use this example to get started with
a new app.php
file:
<?php
require __DIR__ . '/../vendor/autoload.php';
$app = new FrameworkX\App();
$app->get('/', function () {
return new React\Http\Message\Response(
200,
[],
"Hello wörld!\n"
);
});
$app->get('/users/{name}', function (Psr\Http\Message\ServerRequestInterface $request) {
return new React\Http\Message\Response(
200,
[],
"Hello " . $request->getAttribute('name') . "!\n"
);
});
$app->run();
That's it already! The next step is now to serve this web application. One of the nice properties of this project is that is works both behind traditional web server setups as well as in a stand-alone environment.
For example, you can run the above example using PHP's built-in webserver for testing purposes like this:
$ php -S 0.0.0.0:8080 app.php
You can now use your favorite webbrowser or command line tool to check your web application responds as expected:
$ curl -v http://localhost:8080/
HTTP/1.1 200 OK
…
Hello wörld!
Hooked? See website for full documentation.
This project is currently under active development, you're looking at a temporary placeholder repository.
Do you want early access to my unreleased projects? You can either be patient and wait for general availability or consider becoming a sponsor on GitHub for early access.
Do you sponsor me on GitHub? Thank you for supporting sustainable open-source, you're awesome! The prototype is available here: https://github.com/clue-access/framework-x.
Support open-source and join clue·access ❤️
This project will be released under the permissive MIT license.
Did you know that I offer custom development services and issuing invoices for sponsorships of releases and for contributions? Contact me (@clue) for details.