Updated server.js with better checks for credentials, the server will crash with no credentials