you are using node and it's http server. it is your responsibility to parse
the paths and deliver the right file.
you might have a look on expressjs framework, which is a web framework.
there also several module on npm for serving static files.
Am Donnerstag, 12. September 2013 03:43:53 UTC+2 schrieb Tony M:
>
> Hi Group I have a script which is outputting the "fluid.html" example file
> from the twitter-bootstrap node module.
> This is outputting the file to the browser on port 8000 as indicated. My
> question is regarding the correct paths for style sheets and images in this
> scenario. Where traditionally the css and images would exist in a
> "public_html" directory.
>
> var http = require('http'),
> fs = require('fs');
>
>
> fs.readFile('/home/dir/node_modules/twitter-bootstrap/docs/examples/fluid.html',
>
> function (err, html) {
> if (err) {
> throw err;
> }
> http.createServer(function(request, response) {
> response.writeHeader(200, {"Content-Type": "text/html"});
> response.write(html);
> response.end();
> }).listen(8000);
> });
> ~
>
>
>
> The example fluid.html lists this path:
>
> <link href="../assets/css/bootstrap-responsive.css" rel="stylesheet">
>
> Where assets would be under public, presumably.
>
> What is the correct system of applying a path to css and IMGs using node?
> public_html seems old fashioned and apache centric sort of ... Or am I
> missing something? Thanks for anyone who can clarify.
>
>
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.