This library provides Slim Framework 4 utilities for initialising and maintaining both Slim4 JSON based API's and lightweight UI based apps.
These instructions assume a standard app directory structure:
- app
| - api
| | - routes
| - www
| | - routes
- lib
| - ...
initialiser.php
Setting an environment, which can be accessed by routing apps:
\S4S\Slim4\Factory\AppFactory::setEnvironment(\S4S\Slim4\Enum\Environment::\S4S\Slim4\Enum\Development);
$base = __DIR__ . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR;
$app = AppFactory::createJsonApi($base . 'api');
$app->run();
$base = __DIR__ . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR;
$app = AppFactory::createUI($base . 'www');
$app->run();