Remove extra whitespace
This commit is contained in:
parent
6db729813f
commit
56e6959f93
|
|
@ -43,18 +43,18 @@ async function generateDirListing(dirPath, reqUrl) {
|
|||
<h1>Directory: ${reqUrl}</h1>
|
||||
<ul>
|
||||
`;
|
||||
|
||||
|
||||
if (reqUrl !== '/') {
|
||||
html += `<li><a href="../">../ (Parent Directory)</a></li>`;
|
||||
}
|
||||
|
||||
|
||||
for (const file of files) {
|
||||
const filePath = path.join(dirPath, file);
|
||||
const stats = await fs.stat(filePath);
|
||||
const link = encodeURIComponent(file) + (stats.isDirectory() ? '/' : '');
|
||||
html += `<li><a href="${link}">${file}${stats.isDirectory() ? '/' : ''}</a></li>`;
|
||||
}
|
||||
|
||||
|
||||
html += `
|
||||
</ul>
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Reference in New Issue