fix https bug, add main playlists
[ouya-imagestore.git] / www / index.php
1 <?php
2 namespace imagestore;
3
4 require_once __DIR__ . '/../src/imagestore/Autoloader.php';
5 Autoloader::register();
6
7 require_once __DIR__ . '/../data/config.php';
8
9 if (!isset($_SERVER['REDIRECT_URL'])) {
10     $url = '';
11 } else {
12     $url = $_SERVER['REDIRECT_URL'];
13 }
14
15 if (substr($url, 0, 5) == '/api/') {
16     $api = new Controller_Api();
17     $api->handle(substr($url, 5));
18 } else if ($url == '/image') {
19     $api = new Controller_Image();
20     $api->handle($url);
21 } else {
22     header('HTTP/1.0 404 Not Found');
23     echo "I can't handle this request\n";
24 }
25 ?>