Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
223 views
in Technique[技术] by (71.8m points)

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...