-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.php
More file actions
36 lines (28 loc) · 739 Bytes
/
app.php
File metadata and controls
36 lines (28 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET');
require_once __DIR__ . '/vendor/autoload.php';
$avatar = new App\Avatar();
$router = new App\Router($avatar);
$avatar->setImageRoot( __DIR__ . '/images' );
$avatar->setImagesArray( array(
'man' => array(
'/man/001.png',
'/man/002.png',
'/man/003.png',
'/man/004.png',
'/man/005.png'
),
'woman' => array(
'/woman/001.png',
'/woman/002.png',
'/woman/003.png',
'/woman/004.png',
'/woman/005.png'
)
) );
if ( in_array( @$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'] ) ) {
$router->run();
} else {
$router->useHttps()->run();
}