To send HTML and JSON responses using Express.js.
Express can send HTML content using the res.send() method.
Express can send JSON data using the res.json() method.
app.get("/", (req, res) => {
res.send("<h1>Hello from Express!</h1>");
});
app.get("/json", (req, res) => {
res.json({
name: "Madhu",
course: "Node.js",
topic: "Express.js"
});
});