Rename www subdirectories to full domain names
- www/www -> www/www.domain.de - www/api -> www/api.domain.de - www/game -> www/game.domain.de Each domain now has its own directory with public/ Document Root.
This commit is contained in:
18
www/api.domain.de/public/index.php
Normal file
18
www/api.domain.de/public/index.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* api.domain.de — REST API
|
||||
*/
|
||||
header('Content-Type: application/json');
|
||||
$method = $_SERVER['REQUEST_METHOD'];
|
||||
switch ($method) {
|
||||
case 'GET':
|
||||
echo json_encode(['status' => 'ok', 'message' => 'API läuft']);
|
||||
break;
|
||||
case 'POST':
|
||||
$input = json_decode(file_get_contents('php://input'), true);
|
||||
echo json_encode(['status' => 'received', 'data' => $input]);
|
||||
break;
|
||||
default:
|
||||
http_response_code(405);
|
||||
echo json_encode(['error' => 'Method not allowed']);
|
||||
}
|
||||
Reference in New Issue
Block a user