Simplify compose database startup

This commit is contained in:
2026-06-11 13:39:50 +07:00
parent ab46769df1
commit bfd6b1d8cf
2 changed files with 17 additions and 8 deletions
+15
View File
@@ -0,0 +1,15 @@
<?php
header('Content-Type: application/json');
include 'koneksi.php';
$result = $conn->query("SELECT DATABASE() AS db_name, NOW() AS server_time");
$row = $result ? $result->fetch_assoc() : null;
echo json_encode([
"status" => "success",
"db" => $row["db_name"] ?? null,
"server_time" => $row["server_time"] ?? null,
"host_env" => getenv("DB_HOST") ?: null,
"port_env" => getenv("DB_PORT") ?: null,
"user_env" => getenv("DB_USER") ?: null,
]);