App Engine on refresh page gives 404 for my angular2 project?

The question is very similar to How do I make w00> 2 work using App Engine on the refresh page? but I don’t have enough points for comments and he says that he doesn’t put questions in answers.

In any case, the same problem, except for a static hosted site on appspot using Angular cli dist folder:

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

I tried changing the app.yaml app to something similar to Dan's answer linked above, but can't solve it? Here is the app.yaml file:

 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/(.*) 

thanks

0
google-app-engine angular
source share
2 answers

try handlers:

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

add file extensions in the first handler if your application uses more.

works for my application ...

+3
source share

It seems you will need to write an AppEngine script. Check out this link , it seems that all you need.

0
source share

All Articles