Question

I haven't found out anything about my problem so I'd like to ask you if following problem could be solved. I have a nodejs server which displays a website with a button. Is it possible to start another node server (which should do some spookyJS tests and print the results to the website) when i click this button?

I found out that with nowJS you have a shared space which the server and "client" (some html page) share. Is this module helpful?

Thanks for your help, Alex

Was it helpful?

Solution

In short - Yes!

But perhaps you can have both web servers running at all times. In fact, it'll be less of a load on your hardware.

1st Server - Application Server - runs at yoursite.com 2nd Server - SpookyJs/Test Server - runs at tests.yoursite.com

After the servers are up and running the next thing I'd do is wrap the SpookyJs application with a simple restful interface/api. To start tests and to respond with the result of a test.

An important thing to note here is that when you start the SpookyJS application, let stay open. So that every request to the SpookyJS application (through your interface) calls the "open" or the "then" method.

Again, this is to remedy the issue of spawning too many headless browsers.

After the request goes through, go ahead and respond to the request with the result that spooky gives you.

Maybe that helps?

We are doing similar things with Zombie js... so maybe it will help you (:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top