A
A
alexac2013-03-21 16:59:23
JavaScript
alexac, 2013-03-21 16:59:23

Node-webkit, page change and http.Server?

I am writing an application on node-webkit. Decided to use http for communication between multiple computers on which it is running.
Can I not restart http.Server when changing page?
I thought about using child processes, but with them there is a problem in stopping the server - I really don’t want to make it possible to turn off the server through a network request. Hence the question:
How not to lose the object of the child process when changing the page?
What other way can this problem be solved?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexac, 2013-03-21
@alexac

I already found the answer myself in the node-webkit documentation.
There is a variable globalthat is in the context of Node.js, not window.

In node-webkit, you can basically do the same thing by using window.location, you can install it in the onclickevent of a link and node-webkit will navigate to a new page when user clicks it. But by doing this you would lose everything in windowcontext, you can save everything in cookies like old web pages, or you can save things in the globalvariable, which resides in Node.js's context and will live through your app.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question