diff --git a/.gitignore b/.gitignore index 1418e42..d4432b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /vendor/ -/composer.lock -/config.json \ No newline at end of file +/config/* +!/config/example.json + +/composer.lock \ No newline at end of file diff --git a/example/config.json b/config/example.json similarity index 100% rename from example/config.json rename to config/example.json diff --git a/src/server.php b/src/server.php index 8c53d4f..b0787b1 100644 --- a/src/server.php +++ b/src/server.php @@ -11,9 +11,12 @@ $config = json_decode( file_get_contents( __DIR__ . DIRECTORY_SEPARATOR . '..'. - DIRECTORY_SEPARATOR . 'config.json' + DIRECTORY_SEPARATOR . 'config'. + DIRECTORY_SEPARATOR . ( + isset($argv[1]) ? $argv[1] : 'example.json' + ) ) -); +); if (!$config) exit; // Init session $session = [];