import express from "express"; import { dirname } from "path"; import { fileURLToPath } from "url"; // Get the current directory name using the file URL const __dirname = dirname(fileURLToPath(import.meta.url)); const app = express(); const port = 3000; app.use(bodyParser.urlencoded({ extended: true })); app.get("/", (req, res) => { res.send("Hello"); }) app.listen(port, () => { console.log(`Server is running on port ${port}`); });const express = require("express"); const app = express(); const port = 5000; app.use(express.json()); app.get("/", (req, res) => { res.send("Hello"); }); app.listen(port, () => { console.log(`Server running on http://localhost:${port}`); });