diff --git a/backend/server.js b/backend/server.js index 45901b5..a3dfb49 100644 --- a/backend/server.js +++ b/backend/server.js @@ -13,6 +13,11 @@ const PORT = process.env.PORT || 3000; app.use(cors()); app.use(express.json()); app.use("/api/poverty", povertyRoutes); +// ─── Root: landing page (harus sebelum express.static) ─────────────────────── +app.get("/", (req, res) => { + res.sendFile(path.join(__dirname, "../frontend/landing.html")); +}); + // Sajikan folder frontend secara statis app.use(express.static(path.join(__dirname, "../frontend"))); @@ -644,19 +649,22 @@ app.delete("/api/bangunan/:id", async (req, res) => { } }); -// ─── Fallback: semua route non-API ke index.html ───────────────────────────── +// ─── Fallback: semua route non-API ke landing.html ─────────────────────────── app.get("*", (req, res) => { - res.sendFile(path.join(__dirname, "../frontend/index.html")); + res.sendFile(path.join(__dirname, "../frontend/landing.html")); }); // ─── Start ──────────────────────────────────────────────────────────────────── initDatabase().then(() => { app.listen(PORT, () => { console.log(`\n🚀 Server berjalan di http://localhost:${PORT}`); - console.log(` Peta → http://localhost:${PORT}/`); - console.log(` Admin → http://localhost:${PORT}/admin.html`); - console.log(` API → http://localhost:${PORT}/api/spbu`); - console.log(` API → http://localhost:${PORT}/api/jalan`); - console.log(` API → http://localhost:${PORT}/api/bangunan\n`); + console.log(` Portal → http://localhost:${PORT}/`); + console.log(` SPBU → http://localhost:${PORT}/index.html`); + console.log(` Poverty → http://localhost:${PORT}/poverty-map.html`); + console.log(` Pengajuan → http://localhost:${PORT}/pengajuan.html`); + console.log(` Admin → http://localhost:${PORT}/admin.html`); + console.log(` Admin POV → http://localhost:${PORT}/admin-poverty.html`); + console.log(` API SPBU → http://localhost:${PORT}/api/spbu`); + console.log(` API POV → http://localhost:${PORT}/api/poverty\n`); }); }); diff --git a/frontend/landing.html b/frontend/landing.html new file mode 100644 index 0000000..516b9b4 --- /dev/null +++ b/frontend/landing.html @@ -0,0 +1,491 @@ + + +
+ + +Platform pemetaan interaktif berbasis web untuk pengelolaan data spasial SPBU dan distribusi bantuan sosial gereja secara transparan dan tepat sasaran.
+Sistem informasi geografis untuk pemetaan dan manajemen SPBU di Kota Pontianak. Pantau status operasional, jenis BBM, dan jam operasional secara real-time.
+WebGIS untuk memetakan dan mendistribusikan bantuan sosial dari gereja kepada masyarakat yang membutuhkan, berbasis analisis SAW, buffer, dan routing OSM.
+