Open HStewart23 opened 5 years ago
There is a way to refactor all 3 of these functions into 1 function and also have a 404 error which captures all remaining events.
The 404 error may not always be the correct one to send in your handlePublic route function (is it a 404 if there is an error when trying to read a file that exists?)
As I said, super big fan of the way you have split up your files so far this is prehaps something you could do as an extension of that ? In your handler.js file, this block of code (or very similar versions) repeats a few times)
^ This is in your handelHomeRoute
^ This is in your handlePublic route
^ This is in your handleJSON route
Is there a way to make it less repetitive?