title: Where does 'url' in 'var baseUrl = app.get('url').replace(/\/$/, '');' come from in Loopback 3?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>app.start = function() {
    // start the web server
    return app.listen(function() {
      app.emit('started');
      var baseUrl = app.get('url').replace(/\/$/, '');
      console.log('Web server listening at: %s', baseUrl);
      if (app.get('loopback-component-explorer')) {
        var explorerPath = app.get('loopback-component-explorer').mountPath;
        console.log('Browse your REST API at %s%s', baseUrl, explorerPath);
      }
    });
  };</code></pre>
  </div>
  </div>
  </p>
  <p>I'm trying to route a Cloud Foundry app (that uses Loopback 3) to a context path <code>host.domain.com/this-path</code>.</p>
  <p>At first, just using <code>cf create-route</code> and <code>cf map-route</code> didn't work. I'd get a 404 error, so I changed the root.js in my Loopback app to include <code>this-path.</code></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>'use strict';
  
  module.exports = function(server) {
    // Install a `/` route that returns server status
    var router = server.loopback.Router();
    router.get('/this-path', server.loopback.status());
    server.use(router);
  };</code></pre>
  </div>
  </div>
  </p>
  <p>It was able to get the loopback status at <code>host.domain.com/this-path</code>, but API calls/additional paths won't work I just get errors like this. So then I tried changing the Loopback config.json's restApiRoot to include the path as well but that also gave me errors like this:</p>
  <pre><code>&quot;error&quot;: {
          &quot;statusCode&quot;: 404,
          &quot;name&quot;: &quot;Error&quot;,
          &quot;message&quot;: &quot;Cannot POST /this-path/api/make-something&quot;,
          &quot;status&quot;: 404,
          &quot;stack&quot;: &quot;Cannot POST /this-path/api/make-something\n    at raiseUrlNotFoundError (/home/vcap/app/node_modules/loopback/server/middleware/url-not-found.js:21:17)\n    at Layer.handle [as handle_request] (/home/vcap/app/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/home/vcap/app/node_modules/express/lib/router/index.js:317:13)\n    at /home/vcap/app/node_modules/express/lib/router/index.js:284:7\n    at Function.process_params (/home/vcap/app/node_modules/express/lib/router/index.js:335:12)\n    at next (/home/vcap/app/node_modules/express/lib/router/index.js:275:10)\n    at /home/vcap/app/node_modules/express/lib/router/index.js:635:15\n    at next (/home/vcap/app/node_modules/express/lib/router/index.js:260:14)\n    at Function.handle (/home/vcap/app/node_modules/express/lib/router/index.js:174:3)\n    at router (/home/vcap/app/node_modules/express/lib/router/index.js:47:12)\n    at Layer.handle [as handle_request] (/home/vcap/app/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/home/vcap/app/node_modules/express/lib/router/index.js:317:13)\n    at /home/vcap/app/node_modules/express/lib/router/index.js:284:7\n    at Function.process_params (/home/vcap/app/node_modules/express/lib/router/index.js:335:12)\n    at next (/home/vcap/app/node_modules/express/lib/router/index.js:275:10)\n    at nosniff (/home/vcap/app/node_modules/dont-sniff-mimetype/index.js:4:5)&quot;
      }
  }
  </code></pre>
  <p>So now I'm wondering Where does <code>url</code> in <code>var baseUrl = app.get('url').replace(/\/$/, '');</code> come from and can I change it so my app listens on <code>host.domain.com/this-path?</code></p>