You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/09/15 17:28:09 UTC

[GitHub] [apisix-dashboard] liuxiran commented on issue #469: Feature: debug a route online

liuxiran commented on issue #469:
URL: https://github.com/apache/apisix-dashboard/issues/469#issuecomment-692861654


   After research on swagger-ui, and tried to introduce [swagger-ui-react](https://www.npmjs.com/package/swagger-ui-react ) in our project, I found it would be a  feasible solution to do the online debug here, and the **demo** just like this:
   
   1. add a [online debug] button in route list
   ![image](https://user-images.githubusercontent.com/2561857/93241981-b3c07880-f7b8-11ea-8f63-e730899b60b8.png)
   
   1. click the debug button, get the route info, tranfer the data to the swagger json object, then render the debug page
   ![image](https://user-images.githubusercontent.com/2561857/93242244-13b71f00-f7b9-11ea-8d62-c7d62bd448d7.png)
   ![image](https://user-images.githubusercontent.com/2561857/93242400-57aa2400-f7b9-11ea-8ece-61d83fb15161.png)
   
   1. click [Execute] button, directly initiate a cross-domain request to apisix, and then get response
   ![image](https://user-images.githubusercontent.com/2561857/93242763-e028c480-f7b9-11ea-9f90-598857335992.png)
   
   
   The original design was to make a pure front-end function, but due to browser security restrictions, cross-domain requests initiated directly by the front-end cannot directly modify the Host attribute of the request header. This is inconsistent with our business logic, so **this function still needs to rely on manager-api to help forward the request**🤦‍♀️.
   
   How about this proposal? Looking forward to your feedback,thanks @juzhiyuan 
   


----------------------------------------------------------------
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