mark
mark copied to clipboard
Access Static files for images, css, js
It's there's any option for access local static files ? for rendering Images, css, js ?
For example.
use Workerman\Protocols\Http\Response;
$api->get('/img/{file}', function ($request, $file) {
$file = __DIR__ . '/img/' . $file;
return (new Response())->withFile($file);
});