Shane Unger9,413 Points
Code is correct and works, but I'm getting an error in the console
I've implemented the code in this section, and when I go to a url with only a card number I'm redirected to the full url with the query string, but when that happens I get an error in my console
Error: Can't set headers after they are sent, what's causing this and how do I fix it?
Shawn Rieger9,915 Points
I'm sure you've already moved onto the next video and in turn, figured this out. Just for other users looking, I'll put the fix here.
res.redirect() doesn't stop the execution in the
router.get() method, since your also calling
res.render() at the bottom of the function, you get an error. So it's a simple fix, just use return...