jurisv/nodejs.extdirect

serving Direct API from same server as web app, don't want url to say protocol://server:port

Closed this issue · 0 comments

Not only in development but possibly in production too clients will get to server in different way, at different URLs. Might be multiple servers, might be from different networks hence different IP numbers.

The classPath itself would be what we'd want given as url in the API, not a specific server.

In api.js createCachedAPI currently code does

"url": config.protocol + '://' + config.server + (config.port == '80' ? '' : (':'+ config.port))+  config.classPath,

and I think there should be an option if all of protocol, server, and port are falsy (empty string, null, undefine) then it should merely be

"url": config.classPath,

Meanwhile I am looking how to patch that after getting it with protocol://server:port in an Architect project.