我的项目目录看起来像
**demo**
-->
**ui**-->
**dist**-->
**ui**-->
*.html
*.js files
In my app.yaml
runtime: python27
api_version: 1
threadsafe: true`enter code here`
handlers:
- url: /
static_files: dist/\1/index.html
upload: dist/(.*)/(.*)
每当我部署应用程序并点击 URL 时,我都会看到 404 无法加载
资源:服务器对所有文件的状态响应为 404 ()
除了index.html。
任何有关如何进一步进行的帮助将不胜感激。
阅读堆栈溢出相关问题但没有运气
这里我分享一下我使用的方法。
app.yaml
应该看起来像:
runtime: python27
threadsafe: true
api_version: 1
handlers:
- url: /(.+\.js)
static_files: app/\1
upload: app/(.+\.js)
- url: /(.+\.css)
static_files: app/\1
upload: app/(.+\.css)
- url: /(.+\.png)
static_files: app/\1
upload: app/(.+\.png)
- url: /(.+\.jpg)
static_files: app/\1
upload: app/(.+\.jpg)
- url: /(.+\.svg)
static_files: app/\1
upload: app/(.+\.svg)
- url: /favicon.ico
static_files: app/favicon.ico
upload: app/favicon.ico
- url: /(.+\.json)
static_files: app/\1
upload: app/(.+\.json)
- url: /(.+)
static_files: app/index.html
upload: app/index.html
- url: /
static_files: app/index.html
upload: app/index.html
这些处理程序规则可以优化。在这里,我将它们保存在每种文件类型的详细表格中。
目录结构deploy
文件夹应如下所示:
/deploy
app.yaml
/app => generated by ng build
index.html
...bundles..js
/assets
...
此默认服务将在https://YOUR_PROJECT_ID.appspot.com
照常。
也许这些链接可以帮助您:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)