antidot-framework / installer

BSD 2-Clause "Simplified" License
1 stars 1 forks source link

Antidot Framework Installer

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status Maintainability

Antidot Framework skeleton installer. This package let you choosing between different types of Antidot framework project skeletons:

Requirements

Micro HTTP App

Lightweight PSR-15 middleware application.

Dependencies

Routing

You can add your routes with it custom middlewares in public/index.php file, take a look at the example:

<?php
// public/index.php
declare(strict_types=1);

use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Psr\Http\Message\ResponseInterface;
...

    // Application Routes    
    $app->get('/', [
        static function(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
            $request = $request->withAttribute('docs_url', 'https://antidotfw.io');
            return $handler->handle($request);
        },
        static function(ServerRequestInterface $request): ResponseInterface {
            return new JsonResponse([
                'message' => 'Welcome to Antidot Framework Micro HTTP App.',
                'docs' => $request->getAttribute('docs_url'),
            ]);
        }
    ], 'homepage');
...

File structure

config/
    config.php
    container.php
    framework.prod.php
public/
    index.php
test/
var/
    cache/
.gitignore
composer.json
phpcs.xml.dist
phpunit.xml.dist
README.md        

Docker environment