How to create a Mock response in APIGateway

Arun Kumar
Cloud Techies
Feb 8, 2021

--

Goal

To return a static html response for your website.

Steps

  1. First create an API endpoint, choose below type.

2. Select Regional.

3. Create a resource, for example sureroute-test-object.html and create method GET, then Click on GET.

4. Select the Integration Request and select Mock.

5. In the method response, change the default reponse body content type to text/html.

6. In the Integration Response, replace the Mapping Template with Content-Type text/html.

7. Then add the html file into it.

8. Then Select Action Button → Deploy API, create a new Deployment stage.

9. Then go to Custom domain names → <any custom domain> → API mapping tab → Configure API mapping.

10. Create a new API mapping and fill in the below.

11. Thats it, now test the link and you will get result similar to below !

--

--

Arun Kumar
Cloud Techies

Cloud Architect | AWS, GCP, Azure, Python, Kubernetes, Terraform, Ansible