clam2020/public/index.php

37 lines
784 B
PHP
Raw Permalink Normal View History

2018-10-05 16:13:30 +00:00
<?php
use Slim\Factory\AppFactory;
2018-10-05 16:13:30 +00:00
if (PHP_SAPI == 'cli-server') {
// To help the built-in PHP dev server, check if the request was actually for
// something which should probably be served as a static file
$url = parse_url($_SERVER['REQUEST_URI']);
$file = __DIR__ . $url['path'];
if (is_file($file)) {
return false;
}
}
require __DIR__ . '/../vendor/autoload.php';
session_start();
// Set up dependencies
require __DIR__ . '/../src/dependencies.php';
// Instantiate the app
AppFactory::setContainer($container);
$app = AppFactory::create();
2018-10-05 16:13:30 +00:00
// Register middleware
require __DIR__ . '/../src/middleware.php';
// Register routes
require __DIR__ . '/../src/routes.php';
// Require DB
require __DIR__.'/../db/db.php';
// Run app
$app->run();