load($envFile); } // Boot Eloquent BEFORE creating the app Container::boot(); $container = Container::build(); \Slim\Factory\AppFactory::setContainer($container); $app = \Slim\Factory\AppFactory::create(); // CORS Middleware $app->add(new \Tuupola\Middleware\CorsMiddleware([ 'origin' => ['https://fahrschultermin.de', 'https://www.fahrschultermin.de'], 'methods' => ['GET', 'POST', 'PATCH', 'DELETE', 'OPTIONS'], 'headers.allow' => ['Content-Type', 'Authorization', 'X-Requested-With'], 'credentials' => true, 'cache.maxage' => 86400, ])); // Routes (require __DIR__ . '/../src/Routes/api.php')($app); $app->run();