Enabled support for static files from public dir via RoadRunner

This commit is contained in:
Alejandro Celaya 2022-08-27 17:27:54 +02:00
parent 8852739111
commit a4f979be08
3 changed files with 4 additions and 5 deletions

View file

@ -13,14 +13,11 @@ use Shlinkio\Shlink\Config\ConfigAggregator\EnvVarLoaderProvider;
use function class_exists; use function class_exists;
use function Shlinkio\Shlink\Config\env; use function Shlinkio\Shlink\Config\env;
use function Shlinkio\Shlink\Config\openswooleIsInstalled; use function Shlinkio\Shlink\Config\runningInOpenswoole;
use function Shlinkio\Shlink\Config\runningInRoadRunner; use function Shlinkio\Shlink\Config\runningInRoadRunner;
use const PHP_SAPI;
$isTestEnv = env('APP_ENV') === 'test'; $isTestEnv = env('APP_ENV') === 'test';
// TODO Could check for actual openswoole with runningInOpenswoole()?? $enableSwoole = ! runningInRoadRunner() && runningInOpenswoole();
$enableSwoole = PHP_SAPI === 'cli' && ! runningInRoadRunner() && openswooleIsInstalled();
return (new ConfigAggregator\ConfigAggregator([ return (new ConfigAggregator\ConfigAggregator([
! $isTestEnv ! $isTestEnv

View file

@ -8,6 +8,7 @@ server:
http: http:
address: '0.0.0.0:8080' address: '0.0.0.0:8080'
middleware: ['static']
static: static:
dir: '../../public' dir: '../../public'
forbid: ['.php', '.htaccess'] forbid: ['.php', '.htaccess']

View file

@ -8,6 +8,7 @@ server:
http: http:
address: '0.0.0.0:${PORT}' address: '0.0.0.0:${PORT}'
middleware: ['static']
static: static:
dir: '../../public' dir: '../../public'
forbid: ['.php', '.htaccess'] forbid: ['.php', '.htaccess']