You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/07/26 14:56:04 UTC

[GitHub] [incubator-openwhisk-apigateway] chetanmeh opened a new pull request #347: Enable overriding the backend url to enable standalone mode

chetanmeh opened a new pull request #347: Enable overriding the backend url to enable standalone mode
URL: https://github.com/apache/incubator-openwhisk-apigateway/pull/347
 
 
   This PR enables running api gateway with standalone server (#4571). 
   
   It also fixes current broken build by updating the `opm` version
   
   ### Implementation Details
   
   Api Gateway uses the backend url as computed by [makeWebActionBackendUrl][1] in `createApi` call. This backend url is based on url passed by `wsk api` command
   
   ```json
   {"apidoc":{"namespace":"_","gatewayBasePath":"/hello","gatewayPath":"/world","gatewayMethod":"GET","id":"API:_:/hello","action":{"name":"hello","namespace":"_","backendMethod":"GET","backendUrl":"http://localhost:3233/api/v1/web/_/default/hello.http","authkey":"23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP"}}}
   ```
   
   With standalone case this url becomes `http://localhost:3233` and is used as is by api gateway routing logic. So to enable this flow to work the `backendRouting` logic now exposes a env variable `BACKEND_HOST`. If this variable is found to be set then it supersedes the backend url as specified in `createApi` call
   
   [1]: https://github.com/chetanmeh/incubator-openwhisk/blob/29d0d5d922d13e662c20b6bec129ade6d30d0140/core/routemgmt/common/apigw-utils.js#L602

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services