init
This commit is contained in:
17
public/index.php
Normal file
17
public/index.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?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();
|
||||
}
|
||||
Reference in New Issue
Block a user