mapguesser/public/index.php

24 lines
492 B
PHP
Raw Normal View History

<?php
require '../main.php';
// very basic routing
$url = $_SERVER['REQUEST_URI'];
switch($url) {
case '/game':
$controller = new MapGuesser\Controller\GameController();
break;
case '/getNewPosition.json':
$controller = new MapGuesser\Controller\GetNewPosition();
break;
default:
echo 'Error 404';
die;
}
$view = $controller->run();
header('Content-Type: ' . $view->getContentType() . '; charset=UTF-8');
echo $view->render();