Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 451 Bytes

File metadata and controls

18 lines (12 loc) · 451 Bytes

HTTP Surface

<?php

declare(strict_types=1);

use CommonPHP\Assets\AssetManager;
use CommonPHP\Assets\AssetSurface;
use CommonPHP\HTTP\HttpApplication;

$assets = AssetManager::fromRoot(__DIR__ . '/public/assets');

$app = (new HttpApplication())
    ->surface('assets', new AssetSurface($assets), '/assets', 20);

Register the asset surface ahead of broader web surfaces so /assets/... requests do not fall through to page rendering.