Meteor.js deploy to "example.com" or "www.example.com"?

jdscosta91 picture jdscosta91 · Mar 29, 2013 · Viewed 12.1k times · Source

I recently deployed a meteor app using the following command:

$ meteor deploy example.com

and later (thinking that it was the same) using the following:

$ meteor deploy www.example.com

It end up serving two different versions of the app, one hosted in "example.com" and other hosted in "www.example.com".

Can I revert one of the deploys? Which one should I revert?

If not, what kind of configs should I set on my domain provider?

Thank you, Joao

Answer

travellingprog picture travellingprog · Mar 29, 2013

When people go to your page, do you want them to see mydomain.com or www.mydomain.com?

If it's mydomain.com, then you want to set your DNS zone file with an A record for the domain that points to the IP of origin.meteor.com

If it's www.mydomain.com, then you want to set your DNS zone file with a CNAME for the subdomain "www" that points to origin.meteor.com

Then, you want to set "domain forwarding" from one of those choices to the other. For example, I've set up http://playlistparty.net to forward to http://www.playlistparty.net.

After this, you just run:

meteor deploy www.playlistparty.net


You can delete the deployment you won't be using with the --delete option.

meteor deploy www.playlistparty.net --delete