[使用gcloud部署的网页中出现404错误?

问题描述 投票:0回答:1

我遵循了以下链接的每个步骤,试图将一个简单的helloworld网络应用程序(使用与以下链接完全相同的代码)部署到Google Cloud,但部署的Web链接出现404错误。https://cloud.google.com/appengine/docs/standard/python/getting-started/hosting-a-static-website#before_you_begin

这是app.yaml:enter image description here

这里是index.html:

html>
  <head>
    <title>Hello, world!</title>
    <link rel="stylesheet" type="text/css" href="/css/style.css">
  </head>
  <body>
    <h1>Hello, world!</h1>
    <p>
      This is a simple static HTML file that will be served from Google App
      Engine.
    </p>
  </body>
</html>

我不知道为什么会出现404错误,app.yaml文件出了什么问题?

html yaml web-deployment gcloud
1个回答
0
投票

我重新创建了您的用例:

1。这应该是文件夹static的结构:

enter image description here

2。复制了app.yamlindex.html的代码后,在static文件夹中运行以下命令:

 gcloud app deploy
 gcloud app browse

2。转到https://PROJECT_ID.REGION_ID.r.appspot.com

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.