Remove extra whitespace

This commit is contained in:
Reese Levine 2025-11-11 21:40:57 -08:00
parent 6db729813f
commit 56e6959f93
1 changed files with 3 additions and 3 deletions

View File

@ -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>