# same domain name for front end and for lambda function endpoints 

**URL:** <https://forum.serverless.com/t/same-domain-name-for-front-end-and-for-lambda-function-endpoints/4113>\
**Category:** Serverless Framework\
**Tags:** aws, lambda\
**Created:** [March 28, 2018, 3:10pm UTC](https://forum.serverless.com/t/same-domain-name-for-front-end-and-for-lambda-function-endpoints/4113 "2018-03-28T15:10:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://forum.serverless.com/u/Rahul)\
**Post date:** [March 28, 2018, 3:10pm UTC](https://forum.serverless.com/t/same-domain-name-for-front-end-and-for-lambda-function-endpoints/4113/1 "2018-03-28T15:10:29Z")

</div>

How to use same domain name for front end and for lambda function endpoints for Serverless framework ?

---

<div class="post-metadata">

**Author:** ![mspclaims](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/mspclaims/32/1063_2.png) [@mspclaims](https://forum.serverless.com/u/mspclaims)\
**Post date:** [April 9, 2018, 8:26pm UTC](https://forum.serverless.com/t/same-domain-name-for-front-end-and-for-lambda-function-endpoints/4113/2 "2018-04-09T20:26:15Z")

</div>

Create CloudFront distribution and set your front end (i.e. served from S3) as one origin, and API Gateway (entry point to your lambdas) as another origin, and set correspondent behaviours (root goes to front end origin, /api for example - goes to your APIG). I did it manually but you can do it with CloudFormation and embed it into serverless.yml  
Hope it helps
