From 1e32d4a63102d91f48a8ec5bc417eaed2e0b2d0b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 14 Jun 2017 02:03:22 +0000 Subject: [PATCH] add apiUrlPrefix --- README.md | 7 +++++++ lib/apis.js | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index c9419ec..97d0fd8 100644 --- a/README.md +++ b/README.md @@ -243,3 +243,10 @@ The permissions: com.example.hello # refers to /srv/walnut/packages/pages/com.example.hello ''' ``` + +API +--- + +``` +req.apiUrlPrefix => https://api.example.com/api/tld.domain.pkg +``` diff --git a/lib/apis.js b/lib/apis.js index 2b423fc..34d6b24 100644 --- a/lib/apis.js +++ b/lib/apis.js @@ -517,6 +517,12 @@ module.exports.create = function (xconfx, apiFactories, apiDeps) { var hasBeenHandled = false; // Existing (Deprecated) + Object.defineProperty(req, 'apiUrlPrefix', { + enumerable: true + , configurable: false + , writable: false + , value: 'https://' + clientApiUri + '/' + pkgId + }); Object.defineProperty(req, 'experienceId', { enumerable: true , configurable: false