api/playlists and image resizing + delivery
[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 $url = $_SERVER['REDIRECT_URL'];
10 if (substr($url, 0, 5) == '/api/') {
11     $api = new Controller_Api();
12     $api->handle(substr($url, 5));
13 } else if ($url == '/image') {
14     $api = new Controller_Image();
15     $api->handle($url);
16 } else {
17     header('HTTP/1.0 404 Not Found');
18     echo "I can't handle this request\n";
19 }
20 ?>