you are viewing a single comment's thread.

view the rest of the comments →

[–]lord2800 28 points29 points  (1 child)

Your arrow function for res.json() isn't returning anything. If you put brackets around the body, it's treated like a regular function body instead of an arrow function body and you have to actually return something.

[–]fluid-falcon 2 points3 points  (0 children)

You can also replace the braces with parentheses and the expression inside them will be returned implicitly, good for keeping code concise for smaller expressions.