Git Product home page Git Product logo

Comments (4)

ingesolvoll avatar ingesolvoll commented on August 22, 2024 1

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.

ingesolvoll avatar ingesolvoll commented on August 22, 2024 1

Let's keep this open, I would like to be reminded to document this.

from kee-frame.

lsnape avatar lsnape commented on August 22, 2024

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.

lsnape avatar lsnape commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.