----- TestEjs3 Example -------------------------- // TestEjs3 Example // Source code file: main.js // Display a name obtained from a parameter // on the ejs page. For example, use this URL: // localhost:3000/employee/Alice const express = require("express"); const app = express( ); app.set("view engine", "ejs"); app.get("/employee/:name", (q, r) => { var nameFromParam = q.params.name; r.render("employee", {name: nameFromParam}); }); app.listen(3000, ( ) => { console.log("Lietening on port 3000."); }); -------------------------------------------------
Hello, <%= name %>, how are you?
-------------------------------------------------