Possible to use node-webkit to bundle existing node.js server?

2 views
Skip to first unread message

benjami...@gmail.com

unread,
Mar 30, 2014, 11:20:16 AM3/30/14
to node-...@googlegroups.com
Hi,
I am wondering if node-webkit would be of any help to me if I had an existing node.js server that has some service logic and serves some static content and I want this to become a local installable standalone application without changing much of the internal code. In other words, is it possible to use node-webkit to bundle a node.js server and chrome browser where the communication happens through a port and maybe sockets?
If not, is there any alternative?
Thanks,
Ben

Laszlo Z. Antal

unread,
Mar 30, 2014, 1:31:55 PM3/30/14
to node-...@googlegroups.com
Hi,

Yes it would work just fine. In youraon html file check if your server already running if not start it then load the first page. 

Hope it helps

Laszlo

--
You received this message because you are subscribed to the Google Groups "node-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vict...@gmail.com

unread,
Apr 27, 2014, 9:35:10 AM4/27/14
to node-...@googlegroups.com
1. Use node-webkit to load a local.html by setting "main" in package.json.
2. In local.html, use require() to start an express server.
3. In local.html, check until the express is available.
4. When express server is ready, use window.location to jump to the HTTP address.

But after Step 4., the page reloads, and the express server stops.
Is there any way to run express server in background ?

在 2014年3月31日星期一UTC+8上午1时31分55秒,LZAntal写道:
Reply all
Reply to author
Forward
0 new messages