<?php

require './vendor/autoload.php';
require './env.php';

use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;

$configs = [
    'settings' => [
        'displayErrorDetails' => true,
    ],
];

$container = new \Slim\Container($configs);

/*
$container['errorHandler'] = function ($c) {
    return function ($request, $response, $exception) use ($c) {
        $statusCode = $exception->getCode() ? $exception->getCode() : 500;
        return $c['response']->withStatus($statusCode)
            ->withHeader('Content-Type', 'Application/json')
            ->withJson(["mensagem" => $exception->getMessage()], $statusCode);
    };
};
*/

$app = new \Slim\App($container);
