# Replace hard-coded API endpoints using Serverless

**URL:** <https://forum.serverless.com/t/replace-hard-coded-api-endpoints-using-serverless/16133>\
**Category:** Serverless Framework\
**Tags:** lambda, cloudformation\
**Created:** [October 22, 2021, 3:13pm UTC](https://forum.serverless.com/t/replace-hard-coded-api-endpoints-using-serverless/16133 "2021-10-22T15:13:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonathanSifleet](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jonathansifleet/32/6914_2.png) [@JonathanSifleet](https://forum.serverless.com/u/JonathanSifleet)\
**Post date:** [October 22, 2021, 3:13pm UTC](https://forum.serverless.com/t/replace-hard-coded-api-endpoints-using-serverless/16133/1 "2021-10-22T15:13:40Z")

</div>

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:

```auto
return this.http
      .get<{ [key: string]: Review }>(
        'https://....execute-api.eu-west-2.amazonaws.com/dev/...'
      )...

```

With:

```auto
 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.
