Skip to content

Instantly share code, notes, and snippets.

@akrez
Created June 10, 2025 16:33
Show Gist options
  • Select an option

  • Save akrez/cf7a4a3c923b235c251ca7ef33f81849 to your computer and use it in GitHub Desktop.

Select an option

Save akrez/cf7a4a3c923b235c251ca7ef33f81849 to your computer and use it in GitHub Desktop.
Slim
{
"name": "slim/slim-skeleton",
"description": "A Slim Framework skeleton application for rapid development",
"keywords": [
"microframework",
"rest",
"router",
"psr7"
],
"homepage": "http://github.com/slimphp/Slim-Skeleton",
"license": "MIT",
"authors": [
{
"name": "Josh Lockhart",
"email": "[email protected]",
"homepage": "http://www.joshlockhart.com/"
},
{
"name": "Pierre Berube",
"email": "[email protected]",
"homepage": "http://www.lgse.com/"
}
],
"require": {
"php": "^7.4 || ^8.0",
"ext-json": "*",
"guzzlehttp/guzzle": "^7.9",
"monolog/monolog": "^2.8",
"php-di/php-di": "^6.4",
"slim/psr7": "^1.5",
"slim/slim": "^4.10"
},
"require-dev": {
"jangregor/phpstan-prophecy": "^1.0.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.2.0",
"phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^9.5.26",
"squizlabs/php_codesniffer": "^3.7"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
},
"process-timeout": 0,
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"start": "php -S localhost:8080 -t public",
"test": "phpunit"
}
}
<?php
use GuzzleHttp\Client;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
require __DIR__.'/./vendor/autoload.php';
$app = AppFactory::create();
$app->addRoutingMiddleware();
$errorMiddleware = $app->addErrorMiddleware(true, true, true);
$app->get($_SERVER['SCRIPT_NAME'].'/{path:.+}', function (Request $request, Response $response, $args) {
return (new Client)->get('http://localhost/t.mp4');
});
$app->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment