[英]# appears on url after deploy on gcloud
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/时,我在 angular 中的任何路由之前都会出现#
,如下所示:
http://myapp.domain.com/#/dashboard
This is what my app.yaml currently has:这是我的 app.yaml 目前拥有的:
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
Just so this question can be closed successfully: solution is to remove {useHash: true}
from RouterModule config.这样这个问题就可以成功关闭:解决方案是从 RouterModule 配置中删除{useHash: true}
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.