<?php 
/**
* 
* 
*   ██  ██████ ██████  ███████ ██     ██ ████████ ██████   █████   ██████ ██   ██ ███████ ██████  
*   ██ ██      ██   ██ ██      ██     ██    ██    ██   ██ ██   ██ ██      ██  ██  ██      ██   ██ 
*   ██ ██      ██████  █████   ██  █  ██    ██    ██████  ███████ ██      █████   █████   ██████  
*   ██ ██      ██   ██ ██      ██ ███ ██    ██    ██   ██ ██   ██ ██      ██  ██  ██      ██   ██ 
*   ██  ██████ ██   ██ ███████  ███ ███     ██    ██   ██ ██   ██  ██████ ██   ██ ███████ ██   ██                                                                                               
*   
*   MADE WITH LOVE BY ICREWSYSTEMS SOFTWARE ENGINEERING LLP
*
* (c) 2023 iCrewTracker. All rights reserved.
* 
* This file is part of the iCrewTracker software suite.
* Unauthorized copying, modification, distribution, or use of this file, 
* via any medium, is strictly prohibited. This file is proprietary and confidential.
* For license information, please see the LICENSE.md file.
*
* @author ICREWSYSTEMS SOFTWARE ENGINEERING LLP
* @contact legal(at)icrewsystems.com 
* @license UID cbb8060f-5d4c-45aa-8850-f4b8a87d0bcc
* @package-bundle-hash:fe8Hghmq7t7GsZsW7KzHuTe/38L9upjcIflUqo8C5qr9iv/PeQNS
* 
*/


require_once __DIR__ . '/vendor/autoload.php';
require_once "bootstrap.php";
require_once "routes.php";




$method = $_SERVER['REQUEST_METHOD'];
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);

try {
    // Start the application, dispatch routes, etc.
    ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
    $response = $router->dispatch($method, $path);        
} catch (Exception $e) {
    // Handle the exception, for example, log it and show a generic error page.
    error_log($e->getMessage());
    echo $e->getMessage();
    // TODO Create this file. 
    require 'path_to_error_view/error_500.php';
}

?>