Closed cryptoquick closed 2 years ago
I think that's a good request. I've got it on my radar now, thanks.
I'm not sure if it still works this way (it has been a while) but the multipage example used to do routing based on path (/
vs /404
).
This was good advice! I referenced the multipage code and made use of what I needed. This project supports SSR for both HTML and styles. It might be useful to look at for one way Mogwai could be used in a real-world project: https://github.com/Grayblock/grayblock-rs
One issue I've noticed with the SPA router is that it's using fragment-based routing instead of the History API. The problem with that is the fragment is never sent to the server on a request, and so it can't be used to route the app on the backend on SSR. But it's not immediately clear from the SPA routing example how to move to History-based routing.
It might be helpful to reference the Percy isomorphic routing example: https://github.com/chinedufn/percy/tree/master/examples/isomorphic
Notice they keep the app in one folder, and the client and server in separate folders.