REGION_ID는 앱을 만들 때 선택한 리전을 기준으로 Google에서 할당하는 축약된 코드입니다. 일부 리전 ID는 일반적으로 사용되는 국가 및 주/도 코드와 비슷하게 표시될 수 있지만 코드는 국가 또는 주/도와 일치하지 않습니다. 2020년 2월 이후에 생성된 앱의 경우 REGION_ID.r이 App Engine URL에 포함됩니다. 이 날짜 이전에 만든 기존 앱의 경우 URL에서 리전 ID는 선택사항입니다.
파일이 없으면 node_modules 폴더가 업로드되지 않도록 .gcloudignore 파일이 생성됩니다.
Node.js 모듈은 package.json 및 package-lock.json 파일에 나열된 대로 클라우드에 설치되며 서비스는 npm start를 사용하여 시작됩니다.
여러 서비스 배포
서비스별로 app.yaml 파일을 만들어 프로젝트에 여러 서비스를 추가할 수 있습니다. 각 app.yaml 파일에 service 속성을 포함하여 서비스 이름을 지정합니다.
여러 서비스를 사용한 앱 구조화에 대한 자세한 내용은 App Engine의 웹 서비스 구조화를 참조하세요.
여러 서비스를 배포하려면 이 안내를 따르세요.
배포된 각 서비스에는 자체 할당 URL이 있습니다.
서비스 확인
브라우저를 빠르게 시작하고 https://PROJECT_ID.REGION_ID.r.appspot.com에서 웹 서비스에 액세스하려면 다음 명령어를 사용합니다.
gcloudappbrowse
서비스 및 버전
지금까지 서비스를 만들고 App Engine에 배포했습니다.
app.yaml 파일에서 서비스 이름을 지정할 수 있습니다. 이름이 생략되면 default로 처리됩니다. 배포하는 첫 번째 서비스는 기본 서비스여야 합니다.
언제든지 gcloud app deploy 명령어를 다시 실행하여 서비스를 업데이트할 수 있습니다. 배포할 때마다 새로운 버전이 생성되고 트래픽이 최신 버전으로 자동 라우팅됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eGoogle recommends starting with Cloud Run for deploying new Node.js web services, but this guide focuses on deployment via App Engine.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud app deploy\u003c/code\u003e command uploads your source files, builds your Node.js app, and deploys it to App Engine, while \u003ccode\u003egcloud app browse\u003c/code\u003e opens the deployed web service in your browser.\u003c/p\u003e\n"],["\u003cp\u003eYou can deploy multiple services within a project by creating an \u003ccode\u003eapp.yaml\u003c/code\u003e file for each, and specifying the service name, with each service receiving its own unique URL.\u003c/p\u003e\n"],["\u003cp\u003eEach deployment of a service using \u003ccode\u003egcloud app deploy\u003c/code\u003e creates a new version, with traffic automatically directed to the latest version.\u003c/p\u003e\n"],["\u003cp\u003eThe first deployed service on App Engine must be the default service, and if the service name is not specified, it will default to \u003ccode\u003edefault\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Deploy Your Web Service\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n**Note:** If you are deploying a new Node.js web service to Google Cloud, we recommend getting started with [Cloud Run](/run/docs/quickstarts/build-and-deploy/deploy-nodejs-service). \n\n### Region ID\n\nThe \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e is an abbreviated code that Google assigns\nbased on the region you select when you create your app. The code does not\ncorrespond to a country or province, even though some region IDs may appear\nsimilar to commonly used country and province codes. For apps created after\nFebruary 2020, \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e`.r` is included in\nApp Engine URLs. For existing apps created before this date, the\nregion ID is optional in the URL.\n\nLearn more\n[about region IDs](/appengine/docs/standard/nodejs/how-requests-are-routed#region-id). \nOK\n\nThis section of the guide shows how to use the gcloud CLI to deploy your\nNode.js web service on App Engine. To learn more about\nthe Node.js runtime environment, see [Node.js Runtime Environment](/appengine/docs/standard/nodejs/runtime).\n\nBefore you begin\n----------------\n\n1. [Create a Google Cloud project with an App Engine app](/appengine/docs/standard/nodejs/building-app/creating-project).\n2. [Write a Node.js web server ready to deploy on App Engine](/appengine/docs/standard/nodejs/building-app/writing-web-service).\n3. [Install Google Cloud CLI](/sdk/docs/install), which provides the `gcloud` command-line tool. Ensure `gcloud` is configured to use the Google Cloud project you want to deploy to.\n\nKey points\n----------\n\nUse `gcloud app deploy` and `gcloud app browse` to deploy and view your\nservice.\n\nDeploy your service\n-------------------\n\nIn your `my-nodejs-service` folder, where the `app.yaml` file is\nlocated, run the following command in your terminal: \n\n gcloud app deploy\n\nYour source files are then uploaded to Google Cloud Storage. Cloud Build\nbuilds your app and deploys it to App Engine.\n\nFor information about other ways to build and deploy your app,\nsee [Testing and deploying your app](/appengine/docs/standard/testing-and-deploying-your-app).\n| **Note:** Files listed in your [`.gcloudignore`](/sdk/gcloud/reference/topic/gcloudignore) file will not be uploaded.\n\nIf you don't have one, a `.gcloudignore` file is created to ensure that your\n`node_modules` folder is not uploaded.\n\nNode.js modules are installed in the cloud as listed in your `package.json`\nand `package-lock.json` files and your service is started by using `npm start`.\n| **Important:** For the best performance, your `start` script should be lightweight, because it runs whenever a new instance of your application is created.\n\n### Deploy multiple services\n\nYou can add [multiple services](/appengine/docs/an-overview-of-app-engine#services)\nin your project by creating an `app.yaml` file for each service. Include the\n`service` attribute in each `app.yaml` file to specify the name of the service.\nTo learn more about structuring your app using multiple services, see\n[Structuring Web Services in App Engine](/appengine/docs/standard/configuration-files#directory_structure).\n\nTo deploy multiple services, follow [these instructions](/appengine/docs/standard/testing-and-deploying-your-app#deploying_multiple_services).\nEach deployed service will have its own assigned URL.\n\nView your service\n-----------------\n\nTo quickly launch your browser and access your web service at\n\n`https://`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003e\u003ca href=\"#appengine-urls\" style=\"border-bottom: 1px dotted #999\" class=\"devsite-dialog-button\" data-modal-dialog-id=\"regional_url\" track-type=\"progressiveHelp\" track-name=\"modalHelp\" track-metadata-goal=\"regionalURL\"\u003eREGION_ID\u003c/a\u003e\u003c/var\u003e`.r.appspot.com`, use the following\ncommand: \n\n gcloud app browse\n\nServices and versions\n---------------------\n\nYou've just created and deployed a service on App Engine.\nYou can specify the name of your service in the `app.yaml` file. If the\nname is omitted, it is treated as `default`. The first service you deploy\nmust be the default service.\n\nYou can update your service at any time by running the `gcloud app deploy`\ncommand again. Each time you deploy, a new version is created and traffic\nis automatically routed to the latest version.\n\nTo confirm that your service has been created and a version has been deployed:\n\n1. View your App Engine services in the Google Cloud console:\n\n [View services](https://console.cloud.google.com/appengine/services)\n\n You should see one service listed, named `default`. The default service is\n publicly accessible at the following URL:\n\n\n `https://`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003e\u003ca href=\"#appengine-urls\" style=\"border-bottom: 1px dotted #999\" class=\"devsite-dialog-button\" data-modal-dialog-id=\"regional_url\" track-type=\"progressiveHelp\" track-name=\"modalHelp\" track-metadata-goal=\"regionalURL\"\u003eREGION_ID\u003c/a\u003e\u003c/var\u003e`.r.appspot.com`\n2. View your versions:\n\n [View versions](https://console.cloud.google.com/appengine/versions)\n\n You should see one timestamped version listed, corresponding to your\n deployment.\n\nTo learn how to send requests to specific services and versions, see\n[How Requests are Routed](/appengine/docs/standard/how-requests-are-routed).\n\nNext steps\n----------\n\nNow that you have a Node.js server running on App Engine,\n[learn how to make updates to your web service](/appengine/docs/standard/nodejs/building-app/updating-web-service)."]]