Skeleton
This commit is contained in:
10
public/.htaccess
Normal file
10
public/.htaccess
Normal file
@ -0,0 +1,10 @@
|
||||
RewriteEngine On
|
||||
|
||||
# Some hosts may require you to use the `RewriteBase` directive.
|
||||
# If you need to use the `RewriteBase` directive, it should be the
|
||||
# absolute physical path to the directory that contains this htaccess file.
|
||||
#
|
||||
# RewriteBase /
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^ index.php [QSA,L]
|
30
public/index.php
Normal file
30
public/index.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
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();
|
||||
|
||||
// Instantiate the app
|
||||
$settings = require __DIR__ . '/../src/settings.php';
|
||||
$app = new \Slim\App($settings);
|
||||
|
||||
// Set up dependencies
|
||||
require __DIR__ . '/../src/dependencies.php';
|
||||
|
||||
// Register middleware
|
||||
require __DIR__ . '/../src/middleware.php';
|
||||
|
||||
// Register routes
|
||||
require __DIR__ . '/../src/routes.php';
|
||||
|
||||
// Run app
|
||||
$app->run();
|
Reference in New Issue
Block a user