Questa pagina mostra come eseguire più API indipendenti nel tuo dominio personalizzato (ad es. example.com).
Prima di iniziare
Per utilizzare un dominio personalizzato, segui le istruzioni riportate in Verificare un nome di dominio.
Durante la procedura, devi confermare la proprietà del dominio. Questa conferma consente di eseguire il deployment e gestire le API su uno qualsiasi dei relativi sottodomini.
Ad esempio, se la proprietà del dominio è stabilita per example.com, i nomi dei servizi possono includere sottodomini di example.com come api.example.com o catalog.api.example.com.
Deployment di un'API su un sottodominio
L'esempio seguente esegue il deployment dell'API nel sottodominio first_api.example.com:
Imposta il campo host del documento OpenAPI su first_api.example.com
e imposta gli altri campi come descritto in
Configurazione di Cloud Endpoints.
Ora puoi inviare richieste a first_api.example.com e visualizzare i grafici di queste richieste nella pagina Endpoints > Servizi.
Eseguire il deployment della prossima API
Per eseguire il deployment di un'altra API, ripeti i passaggi precedenti, sostituendo il sottodominiofirst_api.example.com con quello che utilizzi per l'API successiva.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis guide explains how to run multiple independent APIs on a custom domain, such as \u003ccode\u003eexample.com\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo use a custom domain, you must first verify ownership of the domain, which allows deploying APIs to any of its subdomains.\u003c/p\u003e\n"],["\u003cp\u003eDeploying an API to a subdomain involves setting the \u003ccode\u003ehost\u003c/code\u003e field in the OpenAPI document and then deploying both the Endpoints configuration and the API backend.\u003c/p\u003e\n"],["\u003cp\u003eEach new API you deploy on your custom domain will require a unique subdomain, with the process being repeated for each one.\u003c/p\u003e\n"]]],[],null,["# Serving multiple APIs from a domain\n\nOpenAPI \\| [gRPC](/endpoints/docs/grpc/deploying-apis-subdomains \"View this page for the Cloud Endpoints gRPC docs\")\n\n\u003cbr /\u003e\n\nThis page shows you how to run multiple independent APIs on your own custom\ndomain (for example, `example.com`).\n\nBefore you begin\n----------------\n\nTo use a custom domain, follow the instructions in\n[Verifying a domain name](/endpoints/docs/openapi/verify-domain-name).\nDuring that process, you must confirm ownership of the domain. This confirmation\nlets you deploy and service APIs on any of its subdomains.\n\nFor example, if domain ownership is established for `example.com`, service names\ncan include subdomains of `example.com` such as `api.example.com` or\n`catalog.api.example.com`.\n\nDeploying an API on a subdomain\n-------------------------------\n\nThe following example deploys the API to the subdomain `first_api.example.com`:\n\n1. Set the `host` field of your OpenAPI document to `first_api.example.com`\n and set the other fields as described in\n [Configuring Cloud Endpoints](/endpoints/docs/openapi/configure-endpoints).\n\n2. [Deploy the Endpoints configuration](/endpoints/docs/openapi/deploy-endpoints-config).\n\n3. [Deploy the API backend](/endpoints/docs/openapi/deploy-api-backend).\n\nNow you can send requests to `first_api.example.com` and view graphs of those\nrequests on the\n[**Endpoints** \\\u003e **Services** page](https://console.cloud.google.com/endpoints).\n\nDeploying your next API\n-----------------------\n\nTo deploy another API, repeat the preceding steps, changing the subdomain\n`first_api.example.com` to the subdomain you are using for the next API."]]