Right now, I have a project like this:
|--.
|--./file1
|--./file2
|--./file3
|--./controller
|--./import
|--./package.json
File1, file2, etc have an Express route in them, and I import them in ./controller
with require
statements. I want controller to be a very clean file - it just has imports and function calls, nothing else - no Express routes.
Now, I want to set up a 404 page with app.get("*",...
. I tried putting it at the end of ./file3, but it didn’t work - do i have to create a new file just for 404 requests for it to work?