Should I turn on the protocol for the Meteor $ ROOT_URL environment variable?

Meteor.absoluteUrl

has a parameter secure

that creates an HTTPS url, so I assume that Meteor only allows the protocol http

or https

. So would there be any difference to not enable the protocol and just use it //example.com/

as an environment variable ROOT_URL

? Or does it matter?

Should I turn on the protocol for the Meteor $ ROOT_URL environment variable?

+3


source to share


2 answers


The Meteor.absoluteUrl implementation can be found here . As you can see, it changes ROOT_URL

( options.rootUrl

) to https

if secure

true and ROOT_URL

uses the protocol http

.

If you are hosting your site using https

anyway, I would recommend including it in ROOT_URL

eg. https://app.example.org

... This is what we do and everything works great. Of course, it's easier to change the environment variable rather than change the code.



Please note that if you do not want to specify the protocol, you must set ROOT_URL

how app.example.org

and not //app.example.org

- see the implantation again.

+4


source


The above answer is no longer correct. It seems like Meteor changed the implementation and now ROOT_URL should be a valid URL with http or https. See https://github.com/meteor/meteor/blob/87681c8f166641c6c3e34958032a5a070aa2d11a/packages/meteor/url_server.js#L8



0


source







All Articles