Sending a Response
COMMAND: res.send()
the parameter can be a string,object,HTML ..etc
const express = require("express");
const app = express();
// console.dir(app);
let port = 3000;
app.listen(port, () => {
console.log(`app is listening on port ${port}`);
});
app.use((req, res) => {
console.log("request received");
// res.send("this is a basic response");
// res.send({
// name:"Abhii",
// weight:60
// });
let code =
"<h1>FRUITS</h1><ul><li>apple</li><li>banana</li><li>orange</li></ul>";
res.send(code);
});
a text
an object
html




Comments
Post a Comment