-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
46 lines (35 loc) · 1.2 KB
/
index.php
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
37
38
39
40
41
42
43
44
45
46
<?php
require_once('lib/limonade.php');
function before () {
ini_set("allow_url_fopen", 1);
}
function displayError($errno, $errstr, $errfile = null, $errline = null) {
return json([
'success' => false,
'error' => [
'code' => $errno,
'message' => $errstr,
'file' => str_replace('\\', '/', $errfile),
'line' => $errline,
],
], JSON_PRETTY_PRINT);
}
function not_found (...$args) {
return displayError(...$args);
}
function server_error (...$args) {
return displayError(...$args);
}
//------
dispatch_get('/icons/search/', 'getSearchIcons'); // takes ?page= and ?filter=(fill/bold/thin) and ?query=
dispatch_get('/icons/popular/', 'getPopularIcons'); // takes ?page=
dispatch_get('/icons/new/', 'getNewIcons'); // takes ?page= and ?filter=(fill-bold/thin)
dispatch_get('/icons/:slug/', 'getIcon'); // takes ?fileType=
dispatch_get('/categories/', 'getCategories');
dispatch_get('/categories/:slug', 'getCategory'); // takes ?page=
dispatch_get('/collections/', 'getCollections'); // takes ?page=
dispatch_get('/collections/:slug', 'getCollection'); // takes ?page=
dispatch_get('/icon-requests/', 'getIconRequests');
dispatch_get('/icon-requests/:slug', 'getIconRequest');
//------
run();