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
|
// example.com/subpath/api should resolve to example.com#subapp
|
||||||
// sub.example.com/subpath/api should resolve to sub.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 clientUrih = req.hostname.replace(/^api\./, '') + req.url.replace(/\/api\/.*/, '/').replace(/\/+/g, '#').replace(/#$/, '');
|
||||||
|
var clientApiUri = req.hostname + req.url.replace(/\/api\/.*/, '/').replace(/\/$/, '');
|
||||||
// Canonical package names
|
// Canonical package names
|
||||||
// '/api/com.daplie.hello/hello' should resolve to 'com.daplie.hello'
|
// '/api/com.daplie.hello/hello' should resolve to 'com.daplie.hello'
|
||||||
// '/subapp/api/com.daplie.hello/hello' should also '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
|
, writable: false
|
||||||
, value: clientUrih
|
, value: clientUrih
|
||||||
});
|
});
|
||||||
|
Object.defineProperty(req, 'clientApiUri', {
|
||||||
|
enumerable: true
|
||||||
|
, configurable: false
|
||||||
|
, writable: false
|
||||||
|
, value: clientApiUri
|
||||||
|
});
|
||||||
Object.defineProperty(req, 'apiId', {
|
Object.defineProperty(req, 'apiId', {
|
||||||
enumerable: true
|
enumerable: true
|
||||||
, configurable: false
|
, configurable: false
|
||||||
|
|
Loading…
Reference in New Issue