Coggle requires JavaScript to display documents.
app.get("/:mainSection", (req, res) => { // destructure the params object const { mainSection } = req.params; res.sendFile(path.join(__dirname, `${mainSection}.html`)); });
req.params
http://localhost:3000/what-is-it/
{ mainSection: "what-is-it" }
http://localhost:3000/how-it-helps/
{ mainSection: "how-it-helps" }
app.get("/:mainSection", (req, res) => { console.log(req.query); ...
http://localhost:3000/what-is-it?type=style
req.query
{ type: 'style' }
app.get("/what-is-it", (req, res) => { res.sendFile(path.join(__dirname, "what-is-it.html")); });
app.get("/", (req, res) => { res.sendFile(path.join(__dirname, "overview.html")); });
app.get("*", (req, res) => { res.send("I don't know that path!!")); });
res.send()