Overview
This document describes how to create an API connecting to Mock on the backend under a created service in the API Gateway console.
Caution:
If the API connects to Mock in the backend, only fixed data can be returned. Therefore, we recommend you use Mock for testings but not in actual business scenarios.
Prerequisites
Directions
1. In the service list, click a service name to enter the API list page.
2. On the General API tab, select Create and enter the API's frontend configuration information.
API Name: name of an API. exampleapi is entered here as an example.
Frontend Type: HTTP and WebSocket are supported. HTTP is selected here as an example.
Path: access path of the API. / is entered here as an example.
Request Method: request method of the API. GET is selected here as an example.
Authentication Type: authentication type of the API. No authentication is selected here as an example.
CORS Support: whether the API supports cross-origin resource sharing. Yes is selected here as an example.
Remarks: remarks of the API. Test is entered here as an example.
Parameter Configuration: frontend parameters of the API. Nothing is entered here.
3. Click Next and enter the backend configuration information of the API.
Backend Type: type of the backend service of the API. Mock is selected here as an example.
Returned Data: data to be returned by Mock. hello world, hello apigateway is entered here as an example.
4. Click Complete.
Was this page helpful?