Comments (4)
Hi! Thanks for posting back :)
You are right, documentation about how to coordinate routing on server and client is absent. I want kee-frame to be a complete solution for getting quickly up and running, so this needs some work.
I like your solution with cljc, I guess you need something like that if you want to be more specific about when to bypass server routing and forward it to the client.
The intention of the sample project is not to ignore the URI. The way I normally do it is to match server urls first, and fall back to index.html on anything that is not found. This is of course not optimal as routes that should normally be 404 will render as index.html. But a fair trade off for simple apps. You can still use a 404 handler in the client, if the route is still not found there.
Another technique is to use things like /api and /client, so anything under /client matches as index.html on the server.
I don't really know if people actually settled on any "best practice" for this, so not sure what to recommend. But definitely need to include it in the README!
from kee-frame.
Let's keep this open, I would like to be reminded to document this.
from kee-frame.
Falling back to index.html and customising the 404 page in the javascript is a perfectly good solution. And since the server requires no knowledge of the UI routes is simpler too. If guidance was provided in the README I would favour this approach over mine, with perhaps a mention of how alternate static pages might be served, and reference to something like the code example above.
Prepending UI routes with /client would also work, but at the expense of making it visible to the customer-facing URLs.
from kee-frame.
FWIW I found a bug with my postwalk
implementation: bidi's route params also match the keyword?
predicate. I've switched to the implementation where :index
is matched if none of the server routes match, and the cljs code displays the 'not found' page.
from kee-frame.
Related Issues (20)
- ::fsm/on-enter subject to race condition HOT 3
- `switch-route` doesn't seem to honour the `nil` case HOT 4
- Unable to set the order of the controllers HOT 1
- Consider allowing specifying actions on DB spec check failure HOT 1
- Consider splitting statecharts-re-frame integration into a separate library HOT 1
- Use speced.def for some core APIs
- "Scroll behavior on navigation" section of the readme seems to be outdated. HOT 2
- Hash Routing on subdirectory not working
- Feature Request: On navigate fx option in `navigate-to` effect.
- make interop/render-root to support React 18?
- reagent.core/render is deprecated HOT 1
- API for overriding certain interceptors
- Controller 2's :start is called before Controller 1's :stop HOT 4
- Use a logging library for debug logging HOT 1
- Using path-params in navigate-to fx HOT 5
- Question regarding reg-controller HOT 7
- Upgrade to re-frame 1.0
- FSM: stop/start behaviour clarification HOT 3
- How does the section about logging relate to the source code?
- Upgrade com.taoensso/timbre dep to avoid compilation warnings HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kee-frame.