I want to make a fully responsive site, and I want to wrap it with Cordova to make a mobile app.
But Cordova only supports hash router.
Can I make my mobile build use Hash Router instead of the normal one, using only one codebase? Or what would be a good routing strategy considering this code reuse need?
i.e Cordova build will use /index.html#user/profile and the web page will use /user/profile
If I recall correctly, Cordova builds will inject a
cordovaproperty into the globalwindowobject. You can check if the current app build is for Cordova and conditionally use one router or the other.Example: