From 0f03514768f4357d40501dfac1f188dad8b09cfe Mon Sep 17 00:00:00 2001 From: Andi Fahruddin Akas Date: Thu, 24 Oct 2024 17:47:37 +0800 Subject: [PATCH] Update index.js --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index cb1a1b55c..2c4b64c10 100644 --- a/index.js +++ b/index.js @@ -6,6 +6,13 @@ const app = express(); // Middleware to handle JSON data app.use(express.json()); +// Route for the root path +app.get("/", (req, res) => { + res.send( + "Welcome to the API! Use /api/desa/:kodedesa/:tahun to access data." + ); +}); + // API endpoint to get JSON data app.get("/api/desa/:kodedesa/:tahun", (req, res) => { const { kodedesa, tahun } = req.params;