I want to build a Service with the Smartphone-App differing from the Website or WebApp respectively. My idea was to have different routing tables in iron router, like so:
/client
- routes.js
/cordova
- routes.js
...
Additionally the files could be enclosed by "if (Meteor.isCordova) {" and "if (Meteor.isClient) {" brackets.
So far I tried this:
Router.map(function() {
if (Meteor.isCordova) {
this.route('homeCordova', {
path: '/'
});
}
if (Meteor.isClient) {
this.route('homeWeb', {
path: '/'
});
}
}
and it works for the paths, but not for the layout, so
if (Meteor.isCordova) {
Router.configure({
layoutTemplate: 'mainLayoutCordova',
loadingTemplate: 'loadingCordova',
...
if (Meteor.isClient) {
Router.configure({
layoutTemplate: 'mainLayout',
loadingTemplate: 'loading',
...
doesn't go.
As an alternative I could have two different Meteor-Apps running at the same time on my server? Does that make any sense?
Any idea how to fix it or how to solve this issue?
The example-app localmarket only has the smartphone app, so only 1 router.js file, also verso, if you're logged in, the WebApp looks pretty much the same as on the phone.
Regards