3 ms·
The code that does this for server-rendered js is in https://github.com/ReactTraining/react-router/blob/master/modules/match.js https://github.com/ReactTraining
by matt4077 10y ago
The code that does this for server-rendered js is in https://github.com/ReactTraining/react-router/blob/master/modules/match.js https://github.com/ReactTraining/react-router/blob/master/mo.... There's code to convert URL patterns to regular expressions in https://github.com/ReactTraining/react-router/blob/master/modules/PatternUtils.js https://github.com/ReactTraining/react-router/blob/master/mo..., although that seems to work only for a single pattern and not all. Presumably you should find a way to convert all patterns to a single regex somewhere in the codebase and could use that to check the request in go.
- oelmekki 10y agoHmmm, indeed. I didn't thought about using react server side rendering and intercepting it to check which status to provide. Good idea, thanks! No, I'll have to think about whether it's worth it adding a whole SSR stack just for that, in my app behind auth :)