-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
24 lines (20 loc) · 690 Bytes
/
index.php
File metadata and controls
24 lines (20 loc) · 690 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
<?php
// Require composer autoloader
require __DIR__ . '/vendor/autoload.php';
// Create Router instance
$router = new \Bramus\Router\Router();
// Define routes
$router->get('/', function() {
print "Hello, World!\n";
});
$router->get('/([0-9]+)-([a-z-]+).html', function($digit, $name) {
print "$digit, $name\n";
});
// $router->get('pattern', function() { /* ... */ });
// $router->post('pattern', function() { /* ... */ });
// $router->put('pattern', function() { /* ... */ });
// $router->delete('pattern', function() { /* ... */ });
// $router->options('pattern', function() { /* ... */ });
// $router->patch('pattern', function() { /* ... */ });
// Run it!
$router->run();