handlers:# All URLs beginning with /stylesheets are treated as paths to# static files in the stylesheets/ directory.-url:/stylesheetsstatic_dir:stylesheets# ...
handlers:# All URLs ending in .gif .png or .jpg are treated as paths to# static files in the static/ directory. The URL pattern is a# regular expression, with a grouping that is inserted into the# path to the file.-url:/(.*\.(gif|png|jpg))$static_files:static/\1upload:static/.*\.(gif|png|jpg)$# ...
[[["易于理解","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-20。"],[[["\u003cp\u003eThe \u003ccode\u003eREGION_ID\u003c/code\u003e is a Google-assigned code based on the app's region, not tied to a specific country or province, and is found in App Engine URLs for apps created after February 2020.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eapp.yaml\u003c/code\u003e file configures App Engine settings, including code, runtime, and version, with each service having its own file and the default service's file being required before creating others.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eruntime\u003c/code\u003e element in \u003ccode\u003eapp.yaml\u003c/code\u003e specifies the app's runtime environment (e.g., \u003ccode\u003ego111\u003c/code\u003e), and it is required for Go 1.11.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ehandlers\u003c/code\u003e element in \u003ccode\u003eapp.yaml\u003c/code\u003e defines URL patterns and how they are handled, allowing for static directories, file mapping, and specifying whether to target app code.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eapp.yaml\u003c/code\u003e enables the configuration of scaling elements such as \u003ccode\u003eautomatic_scaling\u003c/code\u003e, \u003ccode\u003ebasic_scaling\u003c/code\u003e, and \u003ccode\u003emanual_scaling\u003c/code\u003e, to set instance limits, idle times, and concurrent request thresholds.\u003c/p\u003e\n"]]],[],null,["# App Engine app.yaml reference\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/legacy/standard/go111/how-requests-are-routed#region-id). \nOK\n\n\u003cbr /\u003e\n\nYou configure your App Engine app's settings in the `app.yaml`\nfile.\n\nThe `app.yaml` file also contains information about your\napp's code, such as the runtime and the latest version\nidentifier.\n\nEach [service](/appengine/docs/legacy/standard/go111/an-overview-of-app-engine#services)\nin your app has its own `app.yaml` file, which acts as a descriptor for its\ndeployment. You must first create the `app.yaml` file for the `default` service\nbefore you can create and deploy `app.yaml` files for additional services within\nyour app.\n\n\nFor Go 1.11, the `app.yaml` is required to contain at least a\n`runtime` entry. For a brief overview, see\n[Defining Runtime\nSettings](/appengine/docs/legacy/standard/go111/configuring-your-app-with-app-yaml).\n\n\u003cbr /\u003e\n\nDirectory structure\n-------------------\n\nEach service's folder must contain an `app.yaml` file and one or more Go source files that include the `package main` statement at the beginning. To learn more about structuring multiple services in your app, see [Structuring Web Services in App Engine](/appengine/docs/legacy/standard/go111/configuration-files).\n\n\u003cbr /\u003e\n\nExample\n-------\n\nThe following is an example of an `app.yaml` file for a Go 1.11\napplication:\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n```yaml\nruntime: go111\n\ninstance_class: F2\n\nenv_variables:\n BUCKET_NAME: \"example-gcs-bucket\"\n\nhandlers:\n- url: /stylesheets\n static_dir: stylesheets\n\n- url: /(.*\\.(gif|png|jpg))$\n static_files: static/\\1\n upload: static/.*\\.(gif|png|jpg)$\n\n- url: /.*\n script: auto\n```\n\n\u003cbr /\u003e\n\nSyntax\n------\n\nThe syntax of `app.yaml` is the [YAML format](http://www.yaml.org/).\n\nThe YAML format supports comments. A line that begins with a pound (`#`)\ncharacter is ignored: \n\n # This is a comment.\n\nURL and file path patterns use [POSIX extended regular expression\nsyntax](https://wikipedia.org/wiki/Regular_expression), excluding collating\nelements and collation classes. Back-references to grouped matches (e.g. `\\1`)\nare supported, as are these Perl extensions: `\\w \\W \\s \\S \\d \\D`.\n\n### Runtime and app elements\n\n### Handlers element\n\nThe `handlers` element provides a list of URL\npatterns and descriptions of how they should be handled. App Engine can\nhandle URLs by executing application code, or by serving static files uploaded\nwith the code, such as images, CSS, or JavaScript.\n\nPatterns are evaluated in the order they appear in the `app.yaml` file, from\ntop to bottom. The first mapping whose pattern matches the URL is the one used\nto handle the request.\n\nThe following table lists the subelements of the `handlers` element that control\nthe behavior for scripts, static files,\nstatic directories, and other settings.\n\n### Scaling elements\n\nThe elements in following table configure how your application scales. To learn\nmore about how App Engine apps scale, see\n[Scaling types](/appengine/docs/legacy/standard/go111/how-instances-are-managed#scaling_types)."]]