2020-05-17 22:30:22 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require '../main.php';
|
|
|
|
|
|
|
|
// very basic routing
|
|
|
|
$url = $_SERVER['REQUEST_URI'];
|
|
|
|
switch($url) {
|
|
|
|
case '/':
|
|
|
|
$controller = new MapGuesser\Controller\GuessController();
|
|
|
|
break;
|
2020-05-19 03:19:23 +02:00
|
|
|
case '/getNewPosition.json':
|
|
|
|
$controller = new MapGuesser\Controller\GetNewPosition();
|
|
|
|
break;
|
2020-05-17 22:30:22 +02:00
|
|
|
default:
|
|
|
|
echo 'Error 404';
|
|
|
|
die;
|
|
|
|
}
|
|
|
|
|
2020-05-19 03:19:23 +02:00
|
|
|
$view = $controller->run();
|
|
|
|
|
|
|
|
header('Content-Type: ' . $view->getContentType() . '; charset=UTF-8');
|
|
|
|
|
|
|
|
echo $view->render();
|