NodeJS - when using dynamic URL parameters - how can I return a 404 or redirect if no match is found with all URL parameters

Hey all,

So I’ve finished first pass of our dynamic directory using URL paths.

I can have up to 5 parameters in a URL path - currently if someone was to alter the URL it’ll just load the page and return the page structure but with no data as the SC won’t find a match.

I was wondering if anyone had ideas on how I could return a 404 page not found or even redirect the user?

The SC doesn’t return an error when no match found - I was thinking of simply throwing an error and using that but it doesn’t present any error.

Community Page
Last updated: