【发布时间】:2021-10-27 06:18:37
【问题描述】:
我正在 App Engine 上部署一个 Vuejs 应用程序,部署后当我访问应用程序链接时出现 404 错误:
在日志中我看到了这个错误:
找不到处理程序引用的静态文件:dist/index.html
App Engine 上的文件结构是:
- 应用引擎
- 分布
- index.html
- app.yaml
- 分布
我的 App.yaml 文件:
runtime: nodejs12
instance_class: F2
handlers:
# Serve all static files with urls ending with a file extension
- url: /(.*\..+)$
static_files: dist/\1
upload: dist/(.*\..+)$
# catch all handler to index.html
- url: /.*
static_files: dist/index.html
upload: dist/index.html
我尝试上传一个测试文件夹并在其中创建一个 index.html 文件并将处理程序 URL 更改为指向测试文件夹,它可以工作,但是对于 dist 文件夹它不起作用。 对这个问题有帮助吗?
【问题讨论】:
标签: vue.js google-app-engine deployment