Aurora Framework
An Aurora application consists of routes designed to handle specific HTTP requests. Each route triggers a callback and generates an HTTP response. The simplicity of this design allows for easy development and maintenance.
Example Application
Here's a basic Aurora application:
php
<?php
use AuroraLumina\Factory\ApplicationFactory;
use AuroraLumina\Request\ServerRequest;
use AuroraLumina\Request\RequestArguments;
require __DIR__ . '/../vendor/autoload.php';
$app = ApplicationFactory::createApplication();
// Define app routes
$app->get('/hello/{name}', function(ServerRequest $request, RequestArguments $args)
{
$name = $args->name;
return "Hello {$name}";
});
$app->run();
In this example, the /hello/{name}
route triggers a callback that returns a personalized greeting message based on the name
parameter.
Creating a Lumina Project
To create a new Aurora project, use the following Composer command:
bash
composer create-project auroralumina/lumina app
Alternatively, you can install the Aurora framework locally in an existing project:
bash
composer require auroralumina/framework