Closed folkertjan closed 6 years ago
Heya! Awesome work ๐
license.md
is often called LICENSE
. Not a problem, more of an industry standardfs.existsSync
) in Node / server code. Synchronous code blocks the application. For example, while the application is checking if the file exists, all other code is being blocked until its done. So if someone else was trying to look at the site at the same time, the server wouldn't respond since it's busy with the synchronous code. More info: https://nodejs.org/en/docs/guides/blocking-vs-non-blocking/mimetype
for a .jpg
is the same as for a .jpeg
: image/jpeg
. Keep in mind that mimetypes aren't just simply a word followed by the extension. For example, the mimetype for .svg
is image/svg+xml
.throw
ing something in JavaScript is actually a thing. Your throwFourOFour
function doesn't throw
anything, so you might want to consider calling it sendFourOFour
or something ๐ route.indexOf('.') === -1
means the user is requesting a folder in real life. I think the user will more often than not omit the extension when typing a URLabout
a folder too, so it would work with /about
Listing assignment
Repository
link to repository
Feedback
I really enjoyed this assignment because it was a really challenging one. Working with HTTP is totally new to me so it was tough to make the code working. Especially the part where you have to check wether a repository has an index.html file or not was difficult for me. What to do if the repository did contain files, but didn't contain an index.html? I think the code I've written in the end could be much more simple, but I'll have to work with these kind of assignments alot more to get to that point.