-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
49 lines (37 loc) · 883 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
require_once "libraries/Flight/Flight.php";
require_once "commons/configures.php";
require_once "commons/auth.php";
require_once "apis/demo.routes.php";
Flight::route("*", function()
{
$url = Flight::request()->url;
if ($url != "/" and substr($url, -1) == "/")
{
Flight::redirect(rtrim($url, "/"), 301); # 'Moved Permanently'
}
return true;
});
Flight::before("start", function(&$params, &$output)
{
Flight::middle_ware(Flight::request()->url, "is_url_protected");
});
Flight::route("/(index.php|index.html)?", function()
{
Flight::render("index.html.php", $GLOBALS);
});
Flight::route("/home", function()
{
Flight::render_page("home.content.php");
});
Flight::route("/demo", function()
{
Flight::render_page("demo.content.php");
});
Flight::route("/test", function()
{
Flight::render("test.php", $GLOBALS);
});
Flight::initialize();
Flight::start();
?>