<?php

use DI\Container;
use Slim\Factory\AppFactory;
use Slim\Views\Twig;
use Slim\Views\TwigMiddleware;

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

// Create new container object and add our config object to it
$container = new Container();

// Set container to create App with on AppFactory
AppFactory::setContainer($container);
$app = AppFactory::create();

// create Twig instance
$twig = Twig::create('views', ['cache' => false]);
// add Twig-View Middleware
$app->add(TwigMiddleware::create($app, $twig));

// load routes
require_once __DIR__ . '/routes.php';

// app starts in public/index.php
