Azure / api-management-developer-portal

Developer portal provided by the Azure API Management service.
MIT License
488 stars 318 forks source link

How to self host developer portal in local environment for APIM whose domain name is other than managment.azure-api.net #76

Closed anjusharma17 closed 5 years ago

anjusharma17 commented 5 years ago

We are trying to configure our local environment for a APIM whose managementApiUrl is https://testportal.xyz.com instead of "https://testportal.management.azure-api.net". You can see that the domain name of our testportal is xyz.com and not management.azure-api.net.

We are getting below error log for testportal having domain type other than management.azure-api.net.

"https://testportal.xyz.com _(node:13328) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at position 2 at JSON.parse () at IncomingMessage. (C:\Users\anju.c.sharma\azure_devportal\api-management-developer-portal\scripts\generate.js:35:34) at IncomingMessage.emit (events.js:205:15) at endReadableNT (_stream_readable.js:1154:12) at processTicksAndRejections (internal/process/taskqueues.js:84:9) (node:13328) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:13328) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code."

Also the code which is there at generate.js:35:34 is as below resolve(JSON.parse(data));

Please help us to resolve this on priority if it a bug or let us know the way in which this can be achieved if this type of functionality is already implemented? Also , let us know if you need more details as well.

Exception

azaslonov commented 5 years ago

Hi @anjusharma17, thanks for posting the issue. Looks like we need to make provisioning scripts more universal. Please give us a couple of days to do that.

anjusharma17 commented 5 years ago

Hi Alexander,

When we will be getting the updated scripts?

azaslonov commented 5 years ago

Hi Anju, changes merged to master.