RISHI_UTTAM
Intern
Intern
  • UID6911
  • Fans0
  • Follows0
  • Posts11
Reads:345Replies:1

Api Gateway - How to map route parameter to FC http Trigger?

Created#
More Posted time:Oct 21, 2020 0:21 AM
Scenario :


I have 30 function compute http triggers (NODEJS)
example :


/deletePost
/editPost
/getPost
etc.....


I wish to put API GATEWAY in front of all of the above functions.  The role of my API gateway is to check the jwt key in the authorization header of the POST request and use the jwt plugin in API GATEWAY.. I already got this to work sucessfully.  


But instead of creating multiple api gateway endpoints for each function compute trigger, i want to create only one API gateway endpoint for each of my function compute functions... I am sure this should be possible as it is possible with aws api gateway.


I know that i can map [route] /[route] to function compute backend [/route] but i am unabe to get this to work.


I have opened a ticket with Alibaba Customer Support, but since 2 months it seems support does not fully understand my question.


What i want to do is create a api gateway as such


1) user send a post request to /apigateway.myweb.com/deletePost    
2) Api Gateway will map the path "/deletePost" to FC function trigger /deletePost



Currently i cannot get this to work.. If there is  a better solution to create one master api gateway route in order to secure all my function compute trigger please do let me know..


Alibaba Support tells me that i need to create one api gateway for each of my FC trigger.. Tihs does not make any sense to me, as the apigateway is only doing one thing , which is to check the jwt token, so why do i need to create so many api gateway end points when they are all doing the same thing.  The issue is how to map the url path to fc url path correclty.


Thanks
Rishi

RISHI_UTTAM
Intern
Intern
  • UID6911
  • Fans0
  • Follows0
  • Posts11
1st Reply#
Posted time:Nov 20, 2020 23:20 PM
Any help here?
Guest