IG EJS
insta.ejs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Instagram page</title>
</head>
<body>
<h1>Welcome to the page of @<%=username%></h1>
<button>Follow</button>
<button>Message</button>
</body>
</html>
index.js
const express = require("express");
const app = express();
const path = require("path");
const port = 8080;
app.set("view engine", "ejs");
app.set("views", path.join(__dirname, "/views"));
app.get("/ig/:username",(req,res)=>{
let {username}=req.params;
res.render("insta.ejs",{username});
});
app.listen(port, () => {
console.log(`server is listening on port ${port}`);
});


Comments
Post a Comment