18 lines
501 B
PHP
18 lines
501 B
PHP
<?php
|
|
$uri = $_SERVER['REQUEST_URI'];
|
|
|
|
if($uri == '/api'){
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
header('Access-Control-Allow-Origin: *');
|
|
$json = json_decode(file_get_contents('./api.json'), true);
|
|
foreach ($json as $key => $value) {
|
|
$json[$key]['image'] = '//'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].'/images/'.$value['image'];
|
|
}
|
|
echo json_encode($json);
|
|
die();
|
|
}
|
|
if($uri == '/'){
|
|
header('Location: /index.html');
|
|
die();
|
|
}
|