ssrwpo / ssr

SSR - Router with SSR for Node & Meteor
https://ssrwpo.github.io/ssr/
MIT License
93 stars 16 forks source link

does this support cordova hot code push? #43

Closed sirpy closed 7 years ago

sirpy commented 7 years ago

hot code is dependant on serving assets from http://meteorserver/__cordova/ where would requests to /__cordova go? is it possible to direct them to the default meteor handler? Thanks

PEM-- commented 7 years ago

Indeed, I think that those request may be interpreted by Express and RRv4. We could avoid interpreting them by enhancing the following RegExp: https://github.com/ssrwpo/ssr/blob/master/src/server/createRouter.js#L33

PEM-- commented 7 years ago

@sirpy What kinds of assets are requested by Cordova? If they contain a ., the aforementioned should let them delivered by Meteor's server.

sirpy commented 7 years ago

its the hot code push assets, so it can be anything, but mostly javascript files

PEM-- commented 7 years ago

I will prepare a release with this RegExp: /^\/(?!api\/)(?!__cordova\/)[^.]*$/ to be sure that these URLs are handled via Meteor and not Express.

PEM-- commented 7 years ago

Should be good with 2.4.0.

sirpy commented 6 years ago

As a sidenote what i modified in the meteor-react-router-ssr is that by default all routes are not handled by the ssr server only routes that are defined. i think this is a better solution than simply excluding just __cordova, since there might be other packages that want to handle some routes on a lower level and other system routes.