为了账号安全,请及时绑定邮箱和手机立即绑定

使用 gcloud 部署时网页出现 404 错误?

使用 gcloud 部署时网页出现 404 错误?

撒科打诨 2024-01-03 14:58:27
我按照以下链接的每个步骤尝试将一个简单的 helloworld Web 应用程序(使用与以下链接完全相同的代码)部署到谷歌云,但我部署的Web 链接出现 404 错误。这是app.yaml:这是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 文件有什么问题吗?
查看完整描述

1 回答

?
守着一只汪

TA贡献1872条经验 获得超3个赞

我重新创建了您的用例:

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

https://img1.sycdn.imooc.com/659505b800013c3a01650094.jpg

2.复制代码app.yaml并在文件夹index.html中运行以下命令后static

 gcloud app deploy
 gcloud app browse

3.前往https://PROJECT_ID.REGION_ID.r.appspot.com

https://img1.sycdn.imooc.com/659505c3000166e905100087.jpg

查看完整回答
反对 回复 2024-01-03
  • 1 回答
  • 0 关注
  • 27 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信