Closed timruiterkamp closed 6 years ago
Hey @timruiterkamp!
Good job ๐
license.txt
doesn't need the file extension (and is oftentimes uppercased in GitHub) (not right or wrong, but an industry standard)res.statusCOde = 200;
Content-Type
of .jpg
is actually image/jpeg
instead of image/jpg
. Due to this wrong header, the browser will download the file, since it doesn't know how to display it ๐ i was trying to make the files in the images directory into a link so that you could click on it but unfortunately i didn't get that part done in time
I think you were closer than you might think! You know what the file path should be (/images
+ filename) and you have access to the filename in your loop. I think you should be there by changing line 31 from
res.write("<li>" + files[i]+ "</li>");
to
res.write('<a href="/images/' + files[i] + '">' + files[i] + '</a>');
Listing assignment
Here is my link
Overall it was a good challenge, i was trying to make the files in the images directory into a link so that you could click on it but unfortunately i didn't get that part done in time. The /images and /images/ does show the files in the certain directory ๐