<?php

// $app is the Container created by bootstrap.php
/** @var \Sitecake\Container $app */

$configPath = realpath(__DIR__ . '/../config/');
require $configPath . '/bootstrap.php';

$sc = \Sitecake\Sitecake::createInstance($app, $configPath);

if ($app['environment'] === 'test') {
    return $app;
}

// Build and dispatch the request, then send the response
$request  = \Sitecake\Http\Request::createFromGlobals();
$response = $sc->handle($request);
$response->send();
