if (error) {
console.log('error checking username', err);
}
In a handler the above code will just mean that the user never gets a response from the server. Make sure every route through your application ends with a response.end();!
Preferably also give the user nice error messages that explain what went wrong. Leaving console.logs in for yourself so you know how the server is breaking isn't always a bad idea, but it should be secondary to actually serving errors to your users.
In a handler the above code will just mean that the user never gets a response from the server. Make sure every route through your application ends with a
response.end();
!Preferably also give the user nice error messages that explain what went wrong. Leaving console.logs in for yourself so you know how the server is breaking isn't always a bad idea, but it should be secondary to actually serving errors to your users.