Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Andrew Taylor
Index Page
Commits
7f9fa820
Commit
7f9fa820
authored
Feb 23, 2021
by
Andrew Taylor
Browse files
Update app.js
parents
Changes
1
Hide whitespace changes
Inline
Side-by-side
app.js
0 → 100644
View file @
7f9fa820
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
);
});
})
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment