You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why not handle error more nicely on startup?
If hapi returns an error there is no use in trying to continue to boot the server (in 99% of the cases) you will be uncertain of the state your server/hapi will be in.
An easy suggestion is to just check for an error and throw if it is there.
See
Secondly I think it is cleaner to only call .start when you are sure that everything else (hapi wise) is set up. What I mean by that is simply put the start call in the callback of the register call :D
See
Why not handle error more nicely on startup?
If hapi returns an error there is no use in trying to continue to boot the server (in 99% of the cases) you will be uncertain of the state your server/hapi will be in.
An easy suggestion is to just check for an error and throw if it is there.
See
hapijs-birds-api/src/server.js
Line 12 in fbd10df
hapijs-birds-api/src/server.js
Line 38 in fbd10df
Secondly I think it is cleaner to only call
.startwhen you are sure that everything else (hapi wise) is set up. What I mean by that is simply put the start call in the callback of the register call :DSee
hapijs-birds-api/src/server.js
Line 36 in fbd10df
Why not just reply
errhere https://github.com/labsvisual/hapijs-birds-api/blob/master/src/routes.js#L39 ? It will help figure out what is going wrong.