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.

56 lines
1.8 KiB

4 years ago
4 years ago
4 years ago
  1. <?php
  2. header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: *');
  3. header('Access-Control-Allow-Headers: Origin, X-Requested-With,Authorization, Content-Type, Accept');
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Create The Application
  7. |--------------------------------------------------------------------------
  8. |
  9. | The first thing we will do is create a new Laravel application instance
  10. | which serves as the "glue" for all the components of Laravel, and is
  11. | the IoC container for the system binding all of the various parts.
  12. |
  13. */
  14. $app = new Illuminate\Foundation\Application(
  15. $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
  16. );
  17. /*
  18. |--------------------------------------------------------------------------
  19. | Bind Important Interfaces
  20. |--------------------------------------------------------------------------
  21. |
  22. | Next, we need to bind some important interfaces into the container so
  23. | we will be able to resolve them when needed. The kernels serve the
  24. | incoming requests to this application from both the web and CLI.
  25. |
  26. */
  27. $app->singleton(
  28. Illuminate\Contracts\Http\Kernel::class,
  29. App\Http\Kernel::class
  30. );
  31. $app->singleton(
  32. Illuminate\Contracts\Console\Kernel::class,
  33. App\Console\Kernel::class
  34. );
  35. $app->singleton(
  36. Illuminate\Contracts\Debug\ExceptionHandler::class,
  37. App\Exceptions\Handler::class
  38. );
  39. /*
  40. |--------------------------------------------------------------------------
  41. | Return The Application
  42. |--------------------------------------------------------------------------
  43. |
  44. | This script returns the application instance. The instance is given to
  45. | the calling script so we can separate the building of the instances
  46. | from the actual running of the application and sending responses.
  47. |
  48. */
  49. return $app;