Dragon-Knight/public/index.php

20 lines
529 B
PHP

<?php // index.php :: Primary program script, evil alien overlord, you decide.
// define our server path and bootstrap the request
const SERVER = '../server';
require_once SERVER.'/bootstrap.php';
// spin up our app container and the initial route
$app = new App(DB);
$route = App::$req->uri(0);
// redirect depending on installation status
installRedirect($route);
if ($route == '/') return HomeModule::home();
if ($route == 'install') return InstallModule::handle();
// 404
http_response_code(404);
echo '404: ' . $route;