diff --git a/server.php b/server.php index 3f23b8f..816508a 100644 --- a/server.php +++ b/server.php @@ -4,11 +4,11 @@ use Siteworxpro\App\Server; require __DIR__ . '/vendor/autoload.php'; -// Instantiate the ExternalServer class -$server = new Server(); - -// Start the server try { + // Instantiate the ExternalServer class + $server = new Server(); + + // Start the server $server->startServer(); } catch (JsonException $e) { echo $e->getMessage(); diff --git a/src/Server.php b/src/Server.php index 9c597cd..acb7d03 100644 --- a/src/Server.php +++ b/src/Server.php @@ -10,6 +10,7 @@ use League\Route\Http\Exception\MethodNotAllowedException; use League\Route\Http\Exception\NotFoundException; use League\Route\Router; use Nyholm\Psr7\Factory\Psr17Factory; +use Siteworx\Config\Config as SWConfig; use Siteworxpro\App\Controllers\IndexController; use Siteworxpro\App\Http\JsonResponseFactory; use Siteworxpro\App\Http\Middleware\CorsMiddleware; @@ -52,6 +53,7 @@ class Server * Server constructor. * * Initializes the server by booting the PSR-7 worker and router. + * @throws \ReflectionException */ public function __construct() { @@ -74,8 +76,8 @@ class Server Facade::setFacadeContainer($container); // Bind the container to the Config facade first so that it can be used by service providers - $container->bind(\Siteworx\Config\Config::class, function () { - return \Siteworx\Config\Config::load(__DIR__ . '/../config.php'); + $container->bind(SWConfig::class, function () { + return SWConfig::load(__DIR__ . '/../config.php'); }); foreach (self::$serviceProviders as $serviceProvider) {