diff --git a/api/.env b/api/.env index 7208794..72ef434 100644 --- a/api/.env +++ b/api/.env @@ -1,6 +1,6 @@ PRODUCTION=false -DB_HOST="hz-mysql6" +DB_HOST="db.db030.webglobe.com" DB_USER="mysql85033" DB_PASSWORD="troglodyt" DB_DATABASE="mysql122279" diff --git a/api/index.php b/api/index.php index 8ba706a..30cef15 100644 --- a/api/index.php +++ b/api/index.php @@ -18,8 +18,6 @@ function env($key) { $router = new \Bramus\Router\Router(); -$conn = new mysqli(env("DB_HOST"), env("DB_USER"), env("DB_PASSWORD"), env("DB_DATABASE")); -/* $database = new Medoo([ 'type' => 'mysql', 'host' => env("DB_HOST"), @@ -27,7 +25,7 @@ $database = new Medoo([ 'username' => env("DB_USER"), 'password' => env("DB_PASSWORD") ]); -*/ + $data = json_decode(file_get_contents("php://input"), true); $routesDirectory = __DIR__ . "/routes"; diff --git a/api/routes/gamedetails.php b/api/routes/gamedetails.php index 21da317..8a5c30f 100644 --- a/api/routes/gamedetails.php +++ b/api/routes/gamedetails.php @@ -3,6 +3,7 @@ return [ "get" => function($data, $headers, $db) { + var_dump($db); return [ "message" => "hello api" ]; diff --git a/public/.env b/public/.env deleted file mode 100644 index 42a89c3..0000000 --- a/public/.env +++ /dev/null @@ -1,39 +0,0 @@ -#database configuration - -#database host -DB_HOST="localhost" -#database user -DB_USER="root" -#database user password -DB_PASS="" -#database name -DB_NAME="test" -#database port -DB_PORT="mysql" - -#should connect to database? (false if you don't want to use database) -DB_ENABLED=false - -#production flag (true if you want to use production settings) -PRODUCTION=false -#error reporting (true if you want to report errors) -ERROR_REPORTING=true - -#character set for whole application -CHARSET="utf-8" - -#should force redirect to https? (true if you want to use https) -FORCE_HTTPS=false - -#jwt token authentication - -#jwt key for token authentication -#online secure passwords generator - https://www.grc.com/passwords.htm -#generate key by PHP - $jwtKey = bin2hex(random_bytes(32)); -JWT_KEY="" -#encryption algorithm for jwt token -JWT_ALGO="HS256" -#jwt token server name -SERVER_NAME="http://localhost" -#jwt token expiration time in seconds -JWT_EXPIRATION_TIME=3600 diff --git a/public/index.php b/public/index.php index b8bef02..e3a6413 100644 --- a/public/index.php +++ b/public/index.php @@ -1,18 +1,3 @@ load(); - -function env($key, $default = null) { - global $envFile; - - if(isset($envFile[$key])) { - return $envFile[$key]; - } - - return $default; -} - -header('Content-Type: text/html; charset=' . env("CHARSET")); require_once(__DIR__ . '/index.html');