Nick Bull
Nick Bull

Reputation: 9866

Meteor route request for same URL across many apps

Say I had three applications, app-mobile, app-tablet and app-desktop. Now let's imagine that each of these has its own unique page for creating a post, located at http://anapp.com/create-post.

Is it possible to create another Meteor application that performs some if (checkPasses) and routes to the appropriate app and specified route? Something like

if (isMobile)      redirectTo('http://localhost:3100/create-page');
else if (isTablet) redirectTo('http://localhost:3200/create-page');
else               redirectTo('http://localhost:3000/create-page');

but each request still is shown at http://myapp.com/create-page.

Please note that the device query is just an example - I don't care what is the best way for cross-device. This is more about querying a parameter before request and redirecting accordingly to another application depending on the result. I'm also not sure if this is a Meteor specific question, but I'd like to do things such as authenticate a user, so it'd be handy to use Meteor for its functionality for this "redirection" application.

Upvotes: 0

Views: 39

Answers (1)

MrE
MrE

Reputation: 20768

How would you keep track of session / state if the sever the app is talking to changes over the course of the session?

If what you want is serve different content for different type of devices, I would suggest your look into using a reverse-proxy (like nginx) and forward the traffic to a specific server depending on the User-Agent value in the HTTP header.

Upvotes: 1

Related Questions