The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From: "Felix E. Klee" <felix.k...@inka.de>
Date: Fri, 3 Aug 2012 19:07:08 +0200
Local: Fri, Aug 3 2012 1:07 pm
Subject: Re: [nodejs] Serving static files, but not from public directory?
On Fri, Aug 3, 2012 at 5:16 PM, Tim Caswell <t...@creationix.com> wrote:
Actually it's just one file that needs *caching* and *compression*:
> What kind of caching do you want? The other files are just exposed for development (process.env.NODE_ENV
http://example.com/scripts/*.js
And, then I want to provide Socket.IO. Fortunately, the Socket.IO module
What is all this? It's an API that users interface with via an object
The contents of the directory `script` are a bunch of AMD modules. They
> And are you also talking about conditional http requests (Etag,
Nothing complicated - see above. No redirects, no error page, etc.
> timestamps, 304 responses)? What about range request support? > A simple filter in front of any off-the-shelf static file server
I don't want to use a separate file server.
> should five you 95% of what you want. > var staticHandler = require('creationix').static("/", __dirname);
Looks interesting! Reading the source of `static()`...
> Then you'll mount / -> / but only if it ends in ".js" and is not
There are more files that I don't want to serve in `/`. In fact, for
> app.js. security reasons, I don't want to mount `/` at all... > If you don't mind caching your files in memory, then just read the
I see. That's a start for `xyz.js`. I could just use `fs.watchFile`.
> files to ram (either at startup or on demand) and watch the files for > changes (if you want to pick up changes) to invalidate your cache. Then I also need to think about compression. But perhaps the Nodejitsu folks take care of that. > Don't fall into the trap of using a large library that only does 50%
OTOH I don't have any special requirements, and so writing my own static
> of what you [...] file serving code - while surely instructional - seems like reinventing the wheel. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||