79473563

Date: 2025-02-27 18:13:51
Score: 1
Natty:
Report link

As stated in the comments by @Ayush Mhetre the correct answer is to remove the return statement on the same line as the res.status().json() and put it AFTER the call to the response object

So, for ANY Express app it should be

router.get("/", (req: Request, res: Response) => {
    res.status(200).json({});
    return;
}
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @Ayush
  • Low reputation (0.5):
Posted by: Kearney Taaffe