Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
andifahruddinakas committed Oct 24, 2024
1 parent 9bc5147 commit 0f03514
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0f03514

Please sign in to comment.