feat: add module-specific directory structure, routing, and environment security configuration

This commit is contained in:
Syariffullah
2026-06-13 11:23:17 +07:00
parent be05153168
commit 97d18dcabd
10 changed files with 88 additions and 90 deletions
+2 -24
View File
@@ -1,26 +1,4 @@
<?php
// Load konfigurasi dari file .env di root webgis/
require_once dirname(__DIR__) . '/env_loader.php';
$host = env('DB_HOST', 'localhost');
$port = (int) env('DB_PORT', 3306);
$user = env('DB_USER', 'root');
$pass = env('DB_PASS', '');
$db = env('DB_NAME', 'webgis_poverty');
// Koneksi ke MySQL/MariaDB
$conn = new mysqli($host, $user, $pass, $db, $port);
if ($conn->connect_error) {
http_response_code(500);
die(json_encode([
'status' => 'error',
'message' => 'Koneksi database gagal: ' . $conn->connect_error,
]));
}
// Set charset
$conn->set_charset('utf8mb4');
// Jika di-include oleh file API, biarkan $conn tersedia
// Gunakan koneksi terpusat dari root project
require_once dirname(__DIR__) . '/db_connect.php';
?>
+1 -1
View File
@@ -52,7 +52,7 @@
</button>
<!-- Tombol Kembali ke Beranda -->
<a href="/webgis/index.html" class="btn-back-home" title="Kembali ke Beranda">
<a href="../index.html" class="btn-back-home" title="Kembali ke Beranda">
<i class="fas fa-arrow-left"></i>
<span>Beranda</span>
</a>