Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server.listen() - Async #38

Open
vlbee opened this issue Jul 27, 2018 · 0 comments
Open

Server.listen() - Async #38

vlbee opened this issue Jul 27, 2018 · 0 comments

Comments

@vlbee
Copy link

vlbee commented Jul 27, 2018

Keep in mind that Server.listen() is an async function. When you are using it below, there is a risk your console.log will run before the server is actually up and running.

https://github.com/fac-14/Week4TakingAIME/blob/master/src/server.js#L9-L11

Consider popping your console.log into a callback :)

You can read more about Server.listen() parameters here:
https://nodejs.org/api/net.html#net_server_listen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants