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

Running code when server has started #187

Closed
marlun opened this issue Mar 1, 2017 · 2 comments
Closed

Running code when server has started #187

marlun opened this issue Mar 1, 2017 · 2 comments

Comments

@marlun
Copy link

marlun commented Mar 1, 2017

I want to use live-server when running my functional tests. I can do liveServer.start({...}) but how do I know that it has started and is listening for connections so that I can run my tests?

@pavel
Copy link
Contributor

pavel commented Mar 2, 2017

You can do this like so:

var liveServer = LiveServer.start(liveServerOptions);
liveServer.on('listening', function () {
  // server is listening for connections
});
Please, close the issue if your problem is resolved.

@marlun
Copy link
Author

marlun commented Mar 4, 2017

My mistake was trying to do this on LiveServer directly instead of what's returned from start(), thanks!

@marlun marlun closed this as completed Mar 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants