has bug in the /users route, changed the write to database if statement to else/if, seems to have fixed the problem. The problem was that the last part of the function would still attempt to write to the database after checking for email duplicates, whether or not there was a duplicate. This then caused an error because it attempted to send a res.json after all ready sending one during the email check.
has bug in the /users route, changed the write to database if statement to else/if, seems to have fixed the problem. The problem was that the last part of the function would still attempt to write to the database after checking for email duplicates, whether or not there was a duplicate. This then caused an error because it attempted to send a res.json after all ready sending one during the email check.