-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.php
More file actions
35 lines (26 loc) · 1.08 KB
/
Copy pathindex.php
File metadata and controls
35 lines (26 loc) · 1.08 KB
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
<?php
// Load F3
$f3 = require_once dirname(__FILE__) . '/lib/f3/base.php';
// Comment out our debug when in prod
$f3->set('DEBUG',3);
// Load our config file
$f3->config(dirname(__FILE__) . '/etc/master.ini');
// Let F3 load our other things
$autoload_path = "{$f3->get('AWESOME_HOME')}/api/classes/; {$f3->get('AWESOME_HOME')}/lib/;";
$f3->set('AUTOLOAD', $autoload_path);
// API business
$f3->route('GET /api/item/@item_id', 'Item->get_single');
$f3->route('POST /api/item', 'Item->create');
$f3->route('GET /api/item', 'Item->create');
$f3->route('GET /api/item/search', 'Item->search');
$f3->route('GET /api/item/most-awesome', 'Item->most_awesome');
$f3->route('GET /api/item/recently-awesome', 'Item->recently_awesome');
// Service business
$f3->route('POST /api/services/tweet', 'Services->tweet_new_item');
$f3->route('GET /api/services/barcode-lookup', 'Services->barcode_lookup');
$f3->route('GET /api/services/isbn-lookup', 'Services->isbn_lookup');
$f3->route('GET /api/services/wc-lookup', 'Services->wc_lookup');
// Web business
$f3->route('GET /', 'web/index.html');
$f3->run();
?>