add htaccess files and index.php with slim instantiation

This commit is contained in:
Yisroel Baum 2025-10-24 14:16:36 +03:00
parent da1b81663d
commit 22fb98a5b1
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
3 changed files with 23 additions and 0 deletions

4
public/.htaccess Normal file
View file

@ -0,0 +1,4 @@
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

16
public/index.php Normal file
View file

@ -0,0 +1,16 @@
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\RequestInterface as Request;
use Slim\Factory\AppFactory;
require __DIR__ . '/../vendor/autoload.php';
$app = AppFactory::create();
$app->get('/', function (Request $request, Response $response, $args) {
$response->getBody()->write("Hello world!");
return $response;
});
$app->run();