Commit 7f9fa820 authored by Andrew Taylor's avatar Andrew Taylor
Browse files

Update app.js

parents
app.get('/menu', function(req, res){
fs.readdir("public", (err, files) => {
let menu = "<h1>My pages</h1><ul>";
files.forEach(file => {
let link = `<li><a href = '/${file}'>${file}</a></li>`
menu += link
});
menu += "</ul>"
res.send(menu);
});
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment