DEV Community

Arun Kumar for AWS Community Builders

Posted on

5 1

How to create a Mock response in APIGateway

Goal

To return a static html response for your website.

Steps

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

1

b. Select Regional.

2

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

3

d. Select the Integration Request and select Mock.

4

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

5

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

6

g. Then add the html file into it.

7

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

8

i. Then go to Custom domain names → → API mapping tab → Configure API mapping.

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

9

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

10

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Create a simple OTP system with AWS Serverless cover image

Create a simple OTP system with AWS Serverless

Implement a One Time Password (OTP) system with AWS Serverless services including Lambda, API Gateway, DynamoDB, Simple Email Service (SES), and Amplify Web Hosting using VueJS for the frontend.

Read full post

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay