-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
23 lines (14 loc) · 905 Bytes
/
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
<?php
require_once "vendor/autoload.php";
$router = new \Bramus\Router\Router();
$router->setBasePath('/election/');
$router->all('/safe/admin', function() { require __DIR__ . '/views/elections.php'; });
$router->all('/safe/admin/(\w+)', function($electionId) { require __DIR__ . '/views/election.php'; });
$router->all('/safe/vote', function() { require __DIR__ . '/views/vote.php'; });
$router->all('/safe/preview/(\w+)', function($electionId) { require __DIR__ . '/views/preview.php'; });
$router->get('/safe/result/(\w+)', function($electionId) { require __DIR__ . '/views/result.php'; });
$router->get('/safe/turnout/(\w+)', function($electionId) { require __DIR__ . '/views/turnout.php'; });
$router->get('/safe/voterlist/(\w+)', function($vlId) { require __DIR__ . '/views/voterlist.php'; });
$router->all('', function() { require __DIR__ . '/views/index.php'; });
$router->run();
exit();