google-app-engine - 如何为 nodejs Google App Engine 项目制作基本的 app.yaml 文件
问题描述
我正在为谷歌应用引擎制作一个 nodejs 项目。测试一切正常,应用程序正常运行,但是当提示通过 部署我的代码文件时gcloud app deploy
,我收到以下错误:
错误:需要 app.yaml(或 appengine-web.xml)文件才能将此目录部署为 App Engine 应用程序
我以前从未使用过yaml。基本 yaml 文件的内容应该是什么样子才能解决此问题并部署我的代码?
解决方案
正如您在https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html中看到的那样,YAML 的基础很简单,如下所示:
字典 -
key: value
列表/数组 (1) -
name: - item1 - item2
列表/数组 (2) -name: ["item1", "item2"]
嵌套属性 (1) -
nest: nestedKey: value nestedList: - item1 - item2
关于您指定的特定 YAML 文件,请阅读https://cloud.google.com/appengine/docs/flexible/java/configuring-your-app-with-app-yaml了解更多信息。
这是该页面中的一个简单示例:
runtime: java
env: flex
handlers:
- url: /.*
script: this field is required, but ignored
推荐阅读
- python - matplotlib 的 dll 加载失败
- excel - 删除与正在导入的模块同名的模块
- python - Psycopg2 - 使用字符串+数字插入复杂查询?
- vbscript - 我可以在 Outlook 完成启动后自动运行脚本吗?
- c# - 如何从 ItemsSource 标签中的 ViewModel 访问数据
- node.js - npm 链接本地库需要 node_modules 而 git 链接库(相同)不需要
- android - 使用 SQLite Cipher 进行数据库加密后 Android 中的 java.lang.UnsatisfiedLinkError
- amazon-web-services - 如何终止到 elb 的 HTTPS 流量并且容器正在运行 HTTP (fargate)
- android - 设置 actionBarStyle 时状态栏不显示
- php - 如何将数据从 Html 按钮发送到 php 命令