Files
Testing/thunder-tus/examples/server.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

24 lines
648 B
PHP

<?php
use ThunderTUS\Store\FileSystem;
include "vendor/autoload.php";
/*
* Run `composer install` before using this example.
* You can point your Apache / IIS root directory directly at this folder.
*/
$request = Zend\Diactoros\ServerRequestFactory::fromGlobals();
$response = new Zend\Diactoros\Response();
$backend = new FileSystem(__DIR__ . DIRECTORY_SEPARATOR . "uploads");
$server = new ThunderTUS\Server($request, $response);
$server->setStorageBackend($backend);
$server->setApiPath("/");
$server->handle();
$response = $server->getResponse();
$emitter = new Zend\HttpHandlerRunner\Emitter\SapiEmitter();
$emitter->emit($response);