alex_ac
alex_ac

Reputation: 129

node-webkit http.Server and page change

I write an application using node-webkit. I want to use HTTP for network communication between computers, running my app. Can I change current page without server restart if server was started from the page?

I thought about child process, but I want to shutdown the server with my application. I don't want to use special network request to the server to close it.

Can I change current page without server restart? Can I save child process object while page changing? Do you know other way to do this?

P.S. Sorry for my english.

Upvotes: 1

Views: 1040

Answers (1)

alex_ac
alex_ac

Reputation: 129

I found the answer in the node-webkit documentation.

In node-webkit, you can basically do the same thing by using window.location, you can install it in the onclick event 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 window context, you can save everything in cookies like old web pages, or you can save things in the global variable, which resides in Node.js's context and will live through your app.

Upvotes: 1

Related Questions