导航到要上传的 API 代理软件包,然后点击选择。API 代理软件包的结构必须符合 API 代理配置目录结构中的说明。
(可选)默认情况下,使用去掉扩展名的 ZIP 文件名称作为 API 代理的名称。如果此名称不是唯一的,系统会提示您输入唯一名称。
上传的 apiproxy-name 文件夹会添加到工作区中的 apiproxies 下。
管理代理端点
如什么是 API 代理?中所述,代理端点 (ProxyEndpoint) 定义了客户端应用使用 API 的方式。您可以配置代理端点以定义 API 代理的网址。代理端点还确定应用是通过 HTTP 还是 HTTPS 访问 API 代理。您可以向代理端点附加政策,以强制执行安全性、配额检查以及其他类型的访问权限控制和速率限制。
如什么是 API 代理?所述,目标端点 (TargetEndpoint) 定义了 API 代理与后端服务的互动方式。您可以配置目标端点以将请求转发到正确的后端服务,以及定义任何安全设置、HTTP 或 HTTPS 协议和其他连接信息。您可以附加政策到目标端点,以确保为发出初始请求的应用设置正确的响应消息格式。
按照本部分中说明创建和配置目标端点。
创建目标端点
在您创建反向 API 代理时,系统会将默认目标端点添加到 API 代理配置中。创建没有后端目标的 API 代理时,系统仅将默认代理端点添加到 API 代理配置,而不添加目标端点。如需了解详情,请参阅探索默认 API 代理配置。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eThis guide explains how to develop and manage API proxies in Apigee and Apigee hybrid using Cloud Code, which helps decouple app-facing APIs from backend services.\u003c/p\u003e\n"],["\u003cp\u003eAPI proxies can be created through the Cloud Code command palette or by navigating to the \u003ccode\u003eapiproxies\u003c/code\u003e folder, with options for various types, such as \u003ccode\u003eAccess token-based authentication\u003c/code\u003e, \u003ccode\u003eAPI key-based authentication\u003c/code\u003e, \u003ccode\u003eEcho request\u003c/code\u003e, \u003ccode\u003eSimple reverse proxy\u003c/code\u003e, and \u003ccode\u003eOpenAPI 3.0 spec\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUploading existing API proxy bundles is supported, as long as they follow the specified directory structure, and upon upload, they will be integrated into the workspace.\u003c/p\u003e\n"],["\u003cp\u003eProxy endpoints control how clients access APIs and target endpoints manage the API proxy's interaction with backend services; both can be created, configured, and customized with various options, including security, quota, and rate-limiting.\u003c/p\u003e\n"],["\u003cp\u003eThe default configuration for API proxies varies depending on the selected type and authentication method, including options like quota enforcement, API key verification, and OAuth V2 token validation.\u003c/p\u003e\n"]]],[],null,["# Developing API proxies\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\n\u003cbr /\u003e\n\nExpose APIs on Apigee by implementing API proxies. API proxies decouple the app-facing API from your backend services, shielding those apps from backend code changes.\n\nDevelop your API proxies using Apigee in Cloud Code as described in the following sections. See also [Managing folders and files in an Apigee workspace](/apigee/docs/api-platform/local-development/vscode/manage-apigee-workspace#manage-folders-files).\n| **Before you begin** : Familiarize yourself with the concepts described in the following topics:\n|\n| - [Understanding APIs and API proxies](/apigee/docs/api-platform/fundamentals/understanding-apis-and-api-proxies)\n| - [Key points of API proxy development](/apigee/docs/api-platform/fundamentals/structure-api-proxies)\n\nCreating an API proxy\n---------------------\n\nTo create an API proxy using Apigee in Cloud Code, make sure you've created a\n[local development workspace](/apigee/docs/api-platform/local-development/vscode/manage-apigee-workspace)\nand then:\n\n1. Perform one of the following actions:\n\n - In your workspace, position your cursor over the **apiproxies** folder and click .\n\n - Select **View \\\u003e Command Palette** to open the Command palette and select **Cloud Code: Create Apigee proxy bundle**.\n\n The **Create proxy** wizard opens.\n2. Select one of the following options:\n\n3. See [API proxy primary fields](/apigee/docs/api-platform/develop/ui-create-proxy#api-proxy-primary-fields) for information on the fields, such as the base path, needed to create each proxy type. Respond to each of the prompts and press **\u003ckbd\u003eEnter\u003c/kbd\u003e** to confirm and proceed, or **\u003ckbd\u003eEsc\u003c/kbd\u003e** to cancel the wizard.\n\nAfter you complete the steps in the wizard, the new \u003cvar translate=\"no\"\u003eapiproxy-name\u003c/var\u003e folder is added under `apiproxies` in the Apigee section. Each API proxy folder is structured as described in [API proxy configuration directory structure](/apigee/docs/api-platform/reference/api-proxy-configuration-reference#apiproxystructure).\n\nThe following provides an example of the default configuration created for a API proxy created with type `API key-based authentication`.\n\nFor a description of the default configuration, see [Exploring the default API proxy configuration](#default).\n\n### Exploring the default API proxy configuration\n\nThe following table summarizes the contents included in the default configuration when you create an API proxy based on the API proxy type and authentication options selected.\n\nUploading an API proxy bundle\n-----------------------------\n\nTo upload an API proxy bundle to Apigee in Cloud Code:\n\n1. Perform one of the following actions:\n\n - In your Apigee workspace, position your cursor over the **apiproxies** folder and click .\n\n - Select **View \\\u003e Command Palette** to open the Command palette and select **Cloud Code: Import Apigee proxy bundle**.\n\n2. Navigate to the API proxy bundle that you want to upload and click **Select** .\n The API proxy bundle must be structured as described in [API proxy configuration directory structure](/apigee/docs/api-platform/reference/api-proxy-configuration-reference#apiproxystructure).\n\n3. (Optional) By default, the name of the zip file minus its extension is used for the name of the API proxy. If this name is not unique, you are prompted to enter a unique name.\n\nThe uploaded \u003cvar translate=\"no\"\u003eapiproxy-name\u003c/var\u003e folder is added under `apiproxies` in your workspace.\n\nManaging proxy endpoints\n------------------------\n\nAs described in [What is an API proxy?](/apigee/docs/api-platform/fundamentals/understanding-apis-and-api-proxies#whatisanapiproxy), a **proxy endpoint (ProxyEndpoint)** defines the way client apps consume your APIs. You\nconfigure the proxy endpoint to define the URL of your API proxy. The proxy endpoint also\ndetermines whether apps access the API proxy over HTTP or HTTPS. You can [attach policies](/apigee/docs/api-platform/local-development/vscode/manage-policies)\nto the proxy endpoint to enforce security, quota checks, and other types of\naccess control and rate-limiting.\n\nCreate and configure proxy endpoints as described in the following sections.\n\n### Creating proxy endpoints\n\nWhen you [create an API proxy](#create-proxy), a default proxy endpoint is added to the API proxy configuration. For more information, see [Exploring the default API proxy configuration](#default). You can create additional proxy endpoints, as required.\n| **Note** : Before adding multiple proxy endpoints, review the following topic [Antipattern: Define multiple ProxyEndpoints in an API proxy](/apigee/docs/api-platform/antipatterns/multiple-proxyendpoints).\n\nTo create a proxy endpoint using Apigee in Cloud Code:\n\n1. In your Apigee workspace, perform one of the following actions:\n\n - Position your cursor over one of the following folders, click , and select **Create proxy endpoint** :\n - \u003cvar translate=\"no\"\u003eapiproxy-name\u003c/var\u003e proxy bundle\n - \u003cvar translate=\"no\"\u003eapiproxy-name\u003c/var\u003e`/apiproxy`\n - Position your cursor over the **\u003cvar translate=\"no\"\u003eapiproxy-name\u003c/var\u003e`/apiproxy/proxies`** folder and click .\n\n The **Create proxy endpoint** wizard opens.\n2. Enter the values for the next set of prompts. Press **\u003ckbd\u003eEnter\u003c/kbd\u003e** after each to confirm and proceed or **\u003ckbd\u003eEsc\u003c/kbd\u003e** to cancel.\n\nThe endpoint is created and added to the **\u003cvar translate=\"no\"\u003eapiproxy-name\u003c/var\u003e`/apiproxy/proxies`** folder in the Apigee section and opened in the editor. Configure the proxy endpoint, as described in the following section.\n\n### Configuring proxy endpoints\n\nTo configure proxy endpoints, refer to the following sections:\n\n- [Controlling how a proxy executes with flows](/apigee/docs/api-platform/fundamentals/what-are-flows)\n- [Determining the URL of the API proxy endpoint](/apigee/docs/api-platform/fundamentals/understanding-routes#determiningtheurloftheapiproxyendpoint)\n- [Adding features using policies](/apigee/docs/api-platform/local-development/vscode/manage-policies)\n- [Managing resources](/apigee/docs/api-platform/local-development/vscode/manage-resources)\n- [ProxyEndpoint configuration](/apigee/docs/api-platform/reference/api-proxy-configuration-reference#proxyendpoint-apiproxyproxiesdefaultxml)\n- [Flow configuration reference](/apigee/docs/api-platform/reference/flow-configuration-reference)\n- [Endpoint properties reference](/apigee/docs/api-platform/reference/endpoint-properties-reference)\n\nManaging target endpoints\n-------------------------\n\nAs described in [What is an API proxy?](/apigee/docs/api-platform/fundamentals/understanding-apis-and-api-proxies#whatisanapiproxy), a **target endpoint (TargetEndpoint)** defines the way the API proxy interacts with your backend services. You configure the target endpoint to forward requests to the proper backend service, and define any security settings, HTTP or HTTPS protocol, and other connection information. You can [attach policies](/apigee/docs/api-platform/local-development/vscode/manage-policies) to the target endpoint to ensure that response messages are properly formatted for the app that made the initial request.\n\nCreate and configure target endpoints as described in this section.\n\n### Creating target endpoints\n\nWhen you create a reverse API proxy, a default target endpoint is added to the API proxy configuration. When creating an API proxy with no backend target, only the default proxy endpoint is added to the API proxy configuration, no target endpoint is added. For more information, see [Exploring the default API proxy configuration](#default).\n\nCreate target endpoints, as required.\n| **Note**: An API proxy does not need a target endpoint. Proxy endpoints can be configured to call URLs directly. An API proxy with no target endpoints usually contains a proxy endpoint that either directly calls a backend service or is configured to call a service using Java or JavaScript.\n\nTo create a target endpoint using Apigee in Cloud Code:\n\n1. In your Apigee workspace, perform one of the following actions:\n\n - Position your cursor over one of the following folders, click , and select **Create target endpoint** :\n - \u003cvar translate=\"no\"\u003eapiproxy-name\u003c/var\u003e proxy bundle\n - \u003cvar translate=\"no\"\u003eapiproxy-name\u003c/var\u003e`/apiproxy`\n - Position your cursor over the **\u003cvar translate=\"no\"\u003eapiproxy-name\u003c/var\u003e`/apiproxy/targets`** folder and click .\n\n The **Create target endpoint** wizard opens.\n2. Perform the following steps based on the type of target endpoint you want to create:\n\nThe target endpoint is created and added to the **\u003cvar translate=\"no\"\u003eapiproxy-name\u003c/var\u003e`/apiproxy/targets`** folder and opened in the editor. Configure the target endpoint, as described in the following section.\n\n### Configuring target endpoints\n\nConfigure target endpoints, as described in the following topics.\n\n- [Load balancing across backend servers](/apigee/docs/api-platform/deploy/load-balancing-across-backend-servers)\n- [Controlling how a proxy executes with flows](/apigee/docs/api-platform/fundamentals/what-are-flows)\n- [Chaining API proxies together](/apigee/docs/api-platform/fundamentals/connecting-proxies-other-proxies)\n- [Determining the URL of the target endpoint](/apigee/docs/api-platform/fundamentals/understanding-routes#determiningtheurlofthetargetendpoint)\n- [Adding features using policies](/apigee/docs/api-platform/local-development/vscode/manage-policies)\n- [Managing resources](/apigee/docs/api-platform/local-development/vscode/manage-resources)\n- [TargetEndpoint configuration](/apigee/docs/api-platform/reference/api-proxy-configuration-reference#targetendpoint-targetendpointconfiguration)\n- [Flow configuration reference](/apigee/docs/api-platform/reference/flow-configuration-reference)\n- [Endpoint properties reference](/apigee/docs/api-platform/reference/endpoint-properties-reference)\n\n\u003cbr /\u003e"]]