Started code yeaah

This commit is contained in:
Lauren Toivanen 2024-09-27 05:47:54 +03:00
commit ced9eba276
Signed by: jt
GPG key ID: 9151B109B73ECAD5
9 changed files with 115 additions and 0 deletions

4
api/.htaccess Normal file
View file

@ -0,0 +1,4 @@
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
RewriteRule ^ index.php

20
api/index.php Normal file
View file

@ -0,0 +1,20 @@
<?php
$url = explode('/', $_SERVER['REQUEST_URI']);
while ($url[0] !== "api") {
array_shift($url);
}
array_shift($url);
$count = 0;
while (!empty($url[0])) {
switch ($url[0]) {
case 'asd':
echo "asdasd";
break;
default:
echo $url[0] . "\n";
}
$count += 1;
array_shift($url);
}
echo "\n" . $count;
?>