Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (5.6k points)

I'm using a Serverless framework that uses API Gateway to deploy my lambda functions. The frontend is already deployed and they were using the following URL to call an endpoint:

example.com/api/EG43

`exports.myHandler = async function(event, context) {

        ...

        // somehow access the URL which was used by the frontend 

        // to grab that EG43 and then return the result based on that key.

        // return information to the caller.  

 }

where "EG43" is a key that the previous backend was returning the result based on that key. So my question is, whether it's possible to know what the URL is?

1 Answer

0 votes
by (12.4k points)

There are 2 ways in which you can access these details:

1st: You can set up a mapping template and pass in the details you need as part of the payload. You can read more here.

2nd: You can even set up the lambda in Proxy Integration mode, with this you have access to the raw request. You can read it here.

Want to learn more about AWS, then do check out AWS Course offered by Intellipaat.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

Browse Categories

...