Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Meteor Cookbook
  • Toc
  • feedback
Meteor Cookbook

Meteor Cookbook

By : Isaac Strack
4.4 (5)
close
Meteor Cookbook

Meteor Cookbook

4.4 (5)
By: Isaac Strack

Overview of this book

This book is meant for developers of all experience levels looking to create mobile and full-stack web applications in JavaScript. Many of the simple recipes can easily be followed by less-experienced developers, while some of the advanced recipes will require extensive knowledge of existing web, mobile, and server technologies. Any application or enterprise web developer looking to create full-stack JavaScript-based apps will benefit from the recipes and concepts covered in this book.
Table of Contents (14 chapters)
close
13
Index

Deploying to Meteor using a CNAME redirect

Deploying to Meteor test servers is all well and good, but what if you want to use your own custom domain name? The folks at Meteor have created a simple way for you to do just that. This recipe will show you how to take advantage of this simple, yet powerful feature.

Getting ready

You will need to create a CNAME redirect to origin.meteor.com on the hosting service where your domain is registered. How to do this varies pretty widely, so consult your hosting service's knowledge base on the exact steps. For this recipe, we'll use the cPanel interface of a hosting service for the packtpub.com domain.

Enter the subdomain you wish to use in your CNAME redirect (for example, meteor.packtpub.com) and set the redirect location to origin.meteor.com. Click on Add CNAME Record to submit the record:

Getting ready

How to do it…

Let's assume the subdomain we're going to use is meteor.packtpub.com. In order to deploy to the Meteor environment, perform the following steps:

  1. Once you have your CNAME redirect properly set, open a terminal window, navigate to the root directory of your project, and enter the following:
    $ meteor deploy meteor.packtpub.com
    
  2. Meteor will deploy your app and provide feedback as the bundling, uploading, and serving steps are completed:
    Deploying to meteor.packtpub.com.  Bundling...
    Uploading...
    Now serving at meteor.packtpub.com
    
  3. To verify the application, navigate to your application's URL (for example, http://meteor.packtpub.com) in a browser. If everything was deployed correctly, you will see your application up and running.

How it works…

This Meteor deployment feature is nearly identical to the default deployment, with just a little bit of extra code built in to interpret the origin of CNAME redirect.

When a request comes in to origin.meteor.com via a CNAME redirect, Meteor takes the CNAME redirect's original destination and uses it as the unique identifier for the application deployment. Meteor also uses future requests to origin.meteor.com from this CNAME redirect to serve the application.

In this particular case, the original CNAME destination was meteor.packtpub.com. When the request is redirected to origin.meteor.com, Meteor recognizes the CNAME redirect and uses it to direct traffic to the deployed application.

See also

  • The Deploying a test app to Meteor recipe in this chapter
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete