1. Miki Tebeka
  2. nrsc
  3. Issues
Issue #1 resolved

nrsc.Handle() cannot be used with subdirectories(?)

James Pirruccello
created an issue

I have been using NRSC to handle all of my web-accessible static assets, such as CSS and JS. Now I am using it to handle templates as well, but I don't want these to be web accessible. In other words, I want nrsc to hold some public information, and some private information.

Previously, I used the following to serve public assets: nrsc.Handle("/public/")

Now, to accommodate both public and private assets, I have a layout as follows: /resources/ .... /public/ .... /private/

Therefore, I now want to point nrsc.Handle at "/resources/public". However, it seems that I cannot directly refer to the subdirectory: nrsc.Handle("/resources/static/")

The issue is that when I change my links from, e.g., "/public/css/bootstrap.css" to "/resources/static/css/bootstrap.css", I get a 404 now. I believe this is because of the way nrsc does automatic stripping of the entire Handle() string. Perhaps making it a parameter would permit for partial stripping? E.g., Handle("/resources/public/", "/resources/"), although that seems curiously rigid in that it only really gives one additional level of depth, so it's not very general purpose.

I also tried to get around this problem by leaving everything at the root level and simply passing multiple directories to nrsc (e.g., "public, private") but I was not able to get this to work. I'll keep looking into this angle, because it seems more general-purpose.

Comments (5)

  1. Log in to comment