Skip to content
Snippets Groups Projects
Commit 7f9fa820 authored by Andrew Taylor's avatar Andrew Taylor
Browse files

Update app.js

parents
Branches master
No related tags found
No related merge requests found
app.js 0 → 100644
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);
});
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment