tencent cloud

Feedback

Step 3. Create an API with Mock as the Backend Type

Last updated: 2024-01-03 10:03:44

    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.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support