trails icon indicating copy to clipboard operation
trails copied to clipboard

Have a way to retrieve app url

Open jaumard opened this issue 8 years ago • 2 comments

Trailpacks sometimes need to have access to the app url (for email url or url callbacks for example).

Maybe we can simply add a config.main.appUrl who is by default set to 'http://' + config.web.host + ':' + config.web.port and users can override it under main.js.

Like this trailpacks who need app url can always use config.main.appUrl instead of each one try to guess what it is...

related to https://github.com/trailsjs/trails/issues/104

jaumard avatar Mar 28 '16 09:03 jaumard

Yea I think we could set this in config.web. There's no "standard" right now, but I think baseUrl makes sense. Various trailpacks already use hostname and port in config.web

tjwebb avatar Mar 30 '16 06:03 tjwebb

Yeah I think it's better to avoid using host and port directly because how trailpack can detect SSL option ? Because host normally doesn't contains http(s). It will depends of the web server... If there a config.web.baseUrl user can set it with http/https if they want to.

Like this no problems with Trailpack that don't detect baseUrl correctly. Trails (or trailpack-core or each webserver trailpack ?) should set config.web.baseUrl to 'http://' + config.web.host + ':' + config.web.port by default.

jaumard avatar Mar 30 '16 07:03 jaumard