Reserved routes
#4513
Replies: 1 comment 1 reply
-
Remix don't server the static assets like the CSS and client-side JS code by itself. In Express for example you have to setup express.static to serve files from the public folder before you setup the Remix request handler. So |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Would it be worth to add a mechanism to specify "reserved" routes for internal Remix magic that will never match user code?
I managed to shoot myself in the leg when using CF Workers deployment, when I specified a GH secret with wrong KV namespace id, so my app was deleting the
__...-workers_sites_assets
namespace instead of the one I wanted to use for dynamic content (whole boring story on https://twitter.com/aprillion0042/status/1588192612619526145 and StampyAI/stampy-ui#84).I used code like following in
routes/$.tsx
:The combination of the 2 caused my static files like
/build/_assets/root-4XJTI7ZZ.css
to be redirected to/?build/_assets/root-4XJTI7ZZ.css
and I couldn't figure out why it's happening.If Remix set up
/build/_assets/*
as a protected (reserved) route for internal use, unreachable by my own code, that would have been a pit of success for me (I would investigate HTTP 404 instead of HTTP 302 with a wrong mime type and would find the root cause sooner).On the other hand, I understand if some users will want to generate dynamic content for routes like this, there is no 1 size fits all. So I would propose only to have default reserved routes, changeable by the user in "some" configuration file. What do others think?
Beta Was this translation helpful? Give feedback.
All reactions