Very small Web Server cross-platform to use with node-webkit

13 views
Skip to first unread message

francesco....@gmail.com

unread,
Jun 21, 2013, 11:49:19 AM6/21/13
to node-...@googlegroups.com
I understood that the "issue" of / path referencing to root path (C:\ in windows, / in linux) is not something that can be considered an issue, but I definitely need a solution to run my application.
My only option is to run a small webserver (cross platform: linux/windows/mac) that serves only static files (javascript, html and css), so that I can have CSS files placed in whatever nested directory I want without requiring me to type ../../../../ or something similar (and suicide if I move it to a different folder).

Does anyone faced a similar issue and can suggest me an option for this? Maybe node-webkit has an option to specify (through node) which should be the root directory and how can I eventually run html files from there?

Thanks

mark prades

unread,
Jun 21, 2013, 12:27:54 PM6/21/13
to node-...@googlegroups.com, francesco....@gmail.com
If i understand your issue correctly I did , i would like at least to be able to specify a root path for the links in a html page  (in the manifest for instance ). Because it is really a pain in the A$$ to have to run a server for stupid stuffs like that. It is imho my biggest issue with nodewebkit. Other solutions dont have that problem

j.v.tr...@gmail.com

unread,
Nov 7, 2014, 12:01:25 PM11/7/14
to node-...@googlegroups.com, francesco....@gmail.com
Try using the app:// protocol.

Ralf Schwoebel

unread,
Nov 7, 2014, 12:06:06 PM11/7/14
to node-...@googlegroups.com, francesco....@gmail.com
there see different options... 

1st: <base href=..> in the header... that makes your relative paths obsolete

2nd: you may install the node webserver module "npm install http-server -g"

3rd: what j.v.tr...@gmail.com  said...

Francesco Belladonna

unread,
Nov 7, 2014, 12:10:50 PM11/7/14
to Ralf Schwoebel, node-...@googlegroups.com
@Ralf:
1) Doesn't work for anything else except html. The biggest problem however, lies in CSS
2) Node is not available on customer PC
3) That's the real solution

@Jose: Thanks, that's probably a good idea

Ralf Schwoebel

unread,
Nov 7, 2014, 12:29:32 PM11/7/14
to node-...@googlegroups.com, trad...@gmail.com, francesco....@gmail.com
Fancesco, good that you worked it out, but the base href should also work for CSS, as long as you do not @include... in the CSS itself... then it turns relative... right?

Francesco Belladonna

unread,
Nov 7, 2014, 12:42:58 PM11/7/14
to Ralf Schwoebel, node-...@googlegroups.com
Wait, I suppose you are confusing what I'm referring to.
In CSS, if you refer to something with url('......'), this, won't be modified by <base>.
That's what I'm referring to.

Obviously <link> tag will be modified by <base>, but that's still html-related, not css related

Anatoly Pashin

unread,
Nov 7, 2014, 5:21:36 PM11/7/14
to node-...@googlegroups.com

In CSS URL() you can use relative paths and they will be relative to CSS file path.
So URL(test.png) will point to image placed belong with css file, doesn't it?

08 нояб. 2014 г. 3:42 пользователь "Francesco Belladonna" <francesco....@gmail.com> написал:
--
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.
Reply all
Reply to author
Forward
0 new messages