<?php

use Illuminate\Foundation\Application;
use Illuminate\Http\Request;

define('LARAVEL_START', microtime(true));

// Maintenance mode
if (file_exists($maintenance = __DIR__.'/../mileo_backend/storage/framework/maintenance.php')) {
    require $maintenance;
}

// Autoload
require __DIR__.'/../mileo_backend/vendor/autoload.php';

// Bootstrap Laravel
$app = require_once __DIR__.'/../mileo_backend/bootstrap/app.php';

// Handle request
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

$response->send();

$kernel->terminate($request, $response);