Oh wait, I just saw that you ran this before you start listening on the port. That makes a bit more sense.

By the way, the server doesn't wait for this to be done before it starts listening. You could move the listen invocation to be in the body of this callback here.