-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
26 lines (23 loc) · 770 Bytes
/
index.php
File metadata and controls
26 lines (23 loc) · 770 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
<?php
/**
* run in this directory:
* php -S localhost:3000
*/
require_once __DIR__ . '/../lib/router.php';
require_once __DIR__ . '/../lib/template.php';
require_once __DIR__ . '/../controller.php';
// bind the handlers to a regex route
$routes = [
'/' => new Index(),
'/about' => new AboutController(),
'/code-jam' => new CodeJamController(),
'/ai-learning-club' => new AILearningClubController(),
'/blog(?:/([\w\-\_]+)?)?/?' => new BlogController(),
'/sign-up' => new Signup(),
'/resources' => new Resources(),
'/resource/(\d+)' => new ResourceView(),
'/hype-report' => new HypeReport(),
];
$t = new Template(__DIR__ .'/../templates');
$r = new Router($routes, $t, new FourOhFourHandler(), new FiveOhOhHandler());
$r->run();