Search code examples
meteordeploymentdigital-oceanmeteor-up

mup and meteor resolving the url


In my mup settings I have

  "env": {
     "ROOT_URL": "http://localhost",
      "PORT": 3000,
      "UPSTART_UID" : "meteoruser",
      "MAIL_URL": "smtp://username:password@smtp.sendgrid.net:587",
      "METEOR_ENV": "production"
   },

I am following this.

http://johngibby.com/blog/How_to_deploy_your_meteor.js_app_on_Digital_Ocean

Should the port be 3000 or 80 and should the URL be my url?


Solution

  • ROOT_URL should be the url of your DigitalOcean droplet, which leads to your app. For example, if your droplet has an IP of 83.132.230.12, you could do:

      "env": {
         "ROOT_URL": "http://83.132.230.12",
          "PORT": 3000,
          "UPSTART_UID" : "meteoruser",
          "MAIL_URL": "smtp://username:password@smtp.sendgrid.net:587",
          "METEOR_ENV": "production" }
    

    But it will be quite impractical for visitors to connect to http://83.132.230.12 in their web browser. It's better to have a domain name assigned to your droplet, in order to do:

      "env": {
         "ROOT_URL": "http://www.yourdomainname.com",
          "PORT": 3000,
          "UPSTART_UID" : "meteoruser",
          "MAIL_URL": "smtp://username:password@smtp.sendgrid.net:587",
          "METEOR_ENV": "production" }
    

    PORT should be the port on which you want people to access your app. For example, if you give a 3000 port, your app will be accessed through http://www.yourdomainname.com:3000, which looks also impractical. On the other hand, web browsers use port 80 by default. So if you use "PORT": 80, your app will be accessible through http://www.yourdomainname.com (no port required in the url)