Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
724 B

  1. <?php
  2. if (PHP_SAPI == 'cli-server') {
  3. // To help the built-in PHP dev server, check if the request was actually for
  4. // something which should probably be served as a static file
  5. $url = parse_url($_SERVER['REQUEST_URI']);
  6. $file = __DIR__ . $url['path'];
  7. if (is_file($file)) {
  8. return false;
  9. }
  10. }
  11. require __DIR__ . '/../vendor/autoload.php';
  12. session_start();
  13. // Instantiate the app
  14. $settings = require __DIR__ . '/../src/settings.php';
  15. $app = new \Slim\App($settings);
  16. // Set up dependencies
  17. require __DIR__ . '/../src/dependencies.php';
  18. // Register middleware
  19. require __DIR__ . '/../src/middleware.php';
  20. // Register routes
  21. require __DIR__ . '/../src/routes.php';
  22. // Run app
  23. $app->run();