Server crashes on sign up
Closed this issue · 1 comments
oliverjam commented
week6-app-jcnr/routes/signUp.js
Line 42 in 2da645a
I think it's because you're expecting a username
value, but the input in the form has name="name"
. So the username
variable you pass into the model is undefined. Since the scheme says that column is NOT NULL
Postgres is probably throwing an error that isn't getting caught, crashing the whole server.
oliverjam commented
As a more general issue: you need to have .catch
s on all the promises in your routes, otherwise you'll get unhandled rejection errors that Express' default error-handler cannot catch. Even a basic "catch then send <h1>Something went wrong</h1>
" would be better than the server crashing