在App Engine中找不到动态HTML页面.返回无法获取/索引 [英] Dynamic HTML Page not found in App Engine. Returns Cannot Get /index

查看:49
本文介绍了在App Engine中找不到动态HTML页面.返回无法获取/索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在App Engine中托管HTML页面.当我尝试使用url/index访问网页时,它会返回

I am trying to host my HTML page in App Engine. When I am trying to access the webpage with url/index it returns

无法获取/index

Cannot GET /index

我已经按照 https://cloud.google.com/appengine/docs/standard/python/getting-started/hosting-a-static-website 根据上面的链接具有与预期相同的文件结构.

I have followed the steps mentioned in https://cloud.google.com/appengine/docs/standard/python/getting-started/hosting-a-static-website having same file structure as it expects according to the link above.

- my_project
 |- app.js
 |- app.yaml
 |- www
    |- index.html

以下是我的app.yaml文件

The below is my app.yaml file

# [START app_yaml]
runtime: nodejs
env: flex
service: service_name

# Adding CORS Support
handlers:
- url: /index
  static_files: www/index.html
  upload: www/index.html

- url: /index
  static_dir: www/

- url: /getEndPoint
  script: app.js
# [END CORS Support]
# [END app_yaml]

不知道我在这里想念什么.

Not sure what am I missing here.

推荐答案

您正在遵循python第一代标准环境文档,但是您的 app.yaml 选择nodejs灵活环境(并使用语句在此环境的 app.yaml )

You're following the python 1st generation standard environment documentation, but your app.yaml selects the nodejs flexible environment (and uses statements not supported/ignored in this environment's app.yaml)

可能感兴趣:所以你要么:

  • follow the nodejs flexible environment Serving Static Files documentation
  • switch to the nodejs standard environment (by dropping the env:flex statement and selecting the nodejs10 or nodejs8 runtime) and follow the corresponding Serving Static Files documentation.

如果不确定所需的环境,请通过选择一个App Engine环境指南.

If you're unsure which environment you want, go through the Choosing an App Engine Environment guide.

这篇关于在App Engine中找不到动态HTML页面.返回无法获取/索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆