页面刷新的App Engine为我的angular2项目提供404?

Nic*_*las 3 google-app-engine angular

问题非常类似于如何在页面刷新时使Angular 2路由与App Engine一起工作?但我没有足够的评论意见,并表示不回答问题.

无论如何相同的问题,除了它是appspot上的静态托管站点,使用angular cli dist文件夹:

Project
|
+--dist
   |
   +--index.html
   +--inline.js
   +--inline.map
   +--main.bundle.js
   +--main.map
   +--styles.bundle.js
   +--styles.map

+--app.yaml
+--index.yaml
Run Code Online (Sandbox Code Playgroud)

我尝试将我的app.yaml更改为类似于上面链接的Dan的答案,但无法解决这个问题?这是app.yaml文件:

application: 
version: 
runtime: python27
threadsafe: true
api_version: 1

handlers:
- url: /(.*\.js)
  static_files: dist/\1
  upload: dist/(.*\.js)

- url: /(.*\.map)
  mime_type: application/octet-stream
  static_files: dist/\1
  upload: dist/(.*\.map)

- url: /
  static_files: dist/index.html
  upload: dist/index.html

- url: /(.*)
  static_files: dist/\1
  upload: dist/(.*)
Run Code Online (Sandbox Code Playgroud)

谢谢

Ela*_*ram 9

试试这个处理程序:

- url: /(.*\.(gif|png|jpg|css|js)(|\.map))$
 static_files: dist/\1
 upload: dist/(.*)(|\.map)

- url: /(.*)
  static_files: dist/index.html
  upload: dist/index.html
Run Code Online (Sandbox Code Playgroud)

如果您的应用使用更多,请在第一个处理程

适合我的应用......