I’m using Serverless as the framework to produce a website. I know that CloudFormation generates endpoints for lambdas, and so far I have been hard-coding these end-points into HTTP requests for my front-end. What I was wondering was, is it possible (and if so, how?) to replace the hard-coded API endpoints with something not hardcoded?
E.g. in the front-end, replace:
return this.http
.get<{ [key: string]: Review }>(
'https://....execute-api.eu-west-2.amazonaws.com/dev/...'
)...
With:
return this.http
.get<{ [key: string]: Review }>(
[endpoint URL provided by serverless]
)...
I’ve seen this done with Terraform from a colleague during my year in industry so I assume its likely possible with Serverless but some google searches aren’t returning anything, maybe I am searching for the wrong keywords
Any help or pointers would be greatly appreciated.