Home > OS >  # appears on url after deploy on gcloud
# appears on url after deploy on gcloud

Time:09-27

I recently deployed an app on google cloud using app engine and when visitin http://myapp.domain.com/ a # appears before any of my routes in angular, something like this:

http://myapp.domain.com/#/dashboard

This is what my app.yaml currently has:

runtime: python27
api_version: 1
threadsafe: true

skip_files:
- ^(?!dist) 

handlers:
  - url: /
    secure: always
    static_files: dist/myapp/index.html
    upload: dist/myapp/index.html

  #  Routing rules for resources, css, js, images etc. Any file with format filename.ext
  - url: /(.*\.(. ))$
    secure: always
    static_files: dist/myapp/\1
    upload: dist/myapp/(.*\.(. ))$

  #  Routing rule for Angular Routing
  - url: /(.*)
    secure: always
    static_files: dist/myapp/index.html
    upload: dist/myapp/index.html

CodePudding user response:

Just so this question can be closed successfully: solution is to remove {useHash: true} from RouterModule config.

  • Related