caveman icon indicating copy to clipboard operation
caveman copied to clipboard

Opinion - all assets in static/ should serve by default

Open ghost opened this issue 10 years ago • 1 comments

On Hunchentoot, all assets in the web base will serve. As it is common to add third party assets (such as bootstrap) into their own directory, and not mixed with user created css/js, I think it would be more intuitive for a user to be able to just drop in the 'bootstrap-3' directory into "static/" without any additional configuration required.

In my case, I added a "static/assets/" directory and updated the css/js/image regex to match on that as well, but I think it is a silly workaround.

ghost avatar Dec 30 '14 14:12 ghost

Why I'm not very interested in the idea, it may conflict with application's routes.

For example, if you have a route like "/data/:id.json" and also have a directory "/data/" in "static/", the route never been called.

I have a more serious example. Using users' name in routes like "https://github.com/fukamachi" is commonly used, but if there's an user named "data" and you have a directory "static/data/", the user cannot see his/her own user page unexpectedly.

The problem would be caused if there's a user named "js" or "css", however it can be controlled easily.

fukamachi avatar Jan 24 '15 07:01 fukamachi