I deployed an Angular 6 application on Google App Engine. The app.yaml config looks like that:
runtime: python27
api_version: 1
threadsafe: true
skip_files:
Compiled and deployed Angular applications contain of a single index.html
along with a couple of assets, such as JavaScript files. The index file contains all JavaScript files. Routing is performed virtually based on Angulars Router and not based on actual files. Therefore, your configuration can't resolve the routes like /route
. Besides your assets, you have to redirect/rewrite all requests to your index.html
in order to handle these by your Angular routing.
runtime: python27
api_version: 1
threadsafe: true
skip_files:
- (?!^dist)
handlers:
- url: /(.*\.(js|css|svg|png)(|\.map))$
static_files: dist/\1
upload: dist/(.*)(|\.map)
- url: /.*
static_files: dist/index.html
upload: dist/.*
Please adapt the regular expression if you've got more files you're serving.