# Confused about API Gateway and custom domains

**URL:** <https://forum.serverless.com/t/confused-about-api-gateway-and-custom-domains/676>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [October 28, 2016, 12:36am UTC](https://forum.serverless.com/t/confused-about-api-gateway-and-custom-domains/676 "2016-10-28T00:36:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![viz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/viz/32/200_2.png) [@viz](https://forum.serverless.com/u/viz)\
**Post date:** [October 28, 2016, 12:36am UTC](https://forum.serverless.com/t/confused-about-api-gateway-and-custom-domains/676/1 "2016-10-28T00:36:35Z")

</div>

Serverless docs currently contain this statement:

> Currently, every service will create a separate REST API on AWS API Gateway. Due to a limitation with AWS API Gateway, you can only have a custom domain per one REST API. If you plan on making a large REST API, please make note of this limitation. Also, a fix is in the works and is a top priority.

Does this mean that we can’t define multiple base path mappings for a custom domain to different APIs? I can’t see that this is an APIGW limitation as the APIGW UI certainly allows me to create multiple base path mappings pointing to different APIs.

---

<div class="post-metadata">

**Author:** ![endymion](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/endymion/32/178_2.png) [@endymion](https://forum.serverless.com/u/endymion)\
**Post date:** [October 28, 2016, 11:12am UTC](https://forum.serverless.com/t/confused-about-api-gateway-and-custom-domains/676/2 "2016-10-28T11:12:42Z")

</div>

Related question:  
[http://forum.serverless.com/t/api-gateway-same-base-urls-for-my-apis/674](http://forum.serverless.com/t/api-gateway-same-base-urls-for-my-apis/674)

I hope someone could give some advice on this 🙂

---

<div class="post-metadata">

**Author:** ![smkamranqadri](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/smkamranqadri/32/58_2.png) [@smkamranqadri](https://forum.serverless.com/u/smkamranqadri)\
**Post date:** [November 2, 2016, 6:28am UTC](https://forum.serverless.com/t/confused-about-api-gateway-and-custom-domains/676/3 "2016-11-02T06:28:04Z")

</div>

What i did in my project is that i have created multiple services like one service for users and one for chat.

then in custom domain i map [example.com](http://example.com) with base path of ‘users’ to users service and with base path of ‘chat’ to chat server.

---

<div class="post-metadata">

**Author:** ![viz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/viz/32/200_2.png) [@viz](https://forum.serverless.com/u/viz)\
**Post date:** [November 4, 2016, 3:51am UTC](https://forum.serverless.com/t/confused-about-api-gateway-and-custom-domains/676/4 "2016-11-04T03:51:51Z")

</div>

what I’ve found so far is that I can define multiple base path mappings for a specific customer domain. eg, if I have a custom domain of `dev-services.lawpath.com` I can map multiple base paths and end up with things like `https://dev-services.lawpath.com/users` and `https://dev-services.lawpath.com/applications` etc.

The only problem is that I have to define the base path’s manually although I have to admit that I haven’t spent much time trying to work out how to do it from my serverless.yml.

Nevertheless, I do currently have multiple APIs mapped to different base paths on my custom domain.
