如何为Google App Engine应用编写`app.yaml`文件?

1 投票
1 回答
1479 浏览
提问于 2025-04-16 12:17

我注册了一个Google App Engine的应用,下面是我有的一些文件:

  • /index.html - 这是网页的主要文件。
  • /tabs.css - 这是用来美化网页的样式文件。
  • /tab.js - 这是用来添加网页互动功能的脚本文件。
  • /temp.py - 这是一个用Python写的程序文件。

我应该怎么写app.yaml这个配置文件呢?

1 个回答

1

你应该把你的静态文件放到一个文件夹里,比如叫做 staticdata。这样的话,你的 app.yaml 文件看起来会是这样的:

application: temp
version: 1
runtime: python
api_version: 1

handlers:
- url: /staticdata
  static_dir: staticdata

- url: /.*
  script: temp.py

撰写回答