clientApiUri
This commit is contained in:
parent
68e48800c3
commit
614eb960d4
|
@ -395,6 +395,7 @@ module.exports.create = function (xconfx, apiFactories, apiDeps) {
|
|||
// example.com/subpath/api should resolve to example.com#subapp
|
||||
// sub.example.com/subpath/api should resolve to sub.example.com#subapp
|
||||
var clientUrih = req.hostname.replace(/^api\./, '') + req.url.replace(/\/api\/.*/, '/').replace(/\/+/g, '#').replace(/#$/, '');
|
||||
var clientApiUri = req.hostname + req.url.replace(/\/api\/.*/, '/').replace(/\/$/, '');
|
||||
// Canonical package names
|
||||
// '/api/com.daplie.hello/hello' should resolve to 'com.daplie.hello'
|
||||
// '/subapp/api/com.daplie.hello/hello' should also 'com.daplie.hello'
|
||||
|
@ -410,6 +411,12 @@ module.exports.create = function (xconfx, apiFactories, apiDeps) {
|
|||
, writable: false
|
||||
, value: clientUrih
|
||||
});
|
||||
Object.defineProperty(req, 'clientApiUri', {
|
||||
enumerable: true
|
||||
, configurable: false
|
||||
, writable: false
|
||||
, value: clientApiUri
|
||||
});
|
||||
Object.defineProperty(req, 'apiId', {
|
||||
enumerable: true
|
||||
, configurable: false
|
||||
|
|
Loading…
Reference in New Issue