在 Mean Stack2 中刷新页面时出错

Error occurred while refresh the page in Mean Stack2

我只是尝试在 mean stack2 中创建一个项目。 但是,我在刷新浏览器时收到一条错误消息 'Cannot GET/User',如下所示。 我该如何解决?

只需在 app.module.ts class.

中的 @NgModule 装饰器中添加以下代码
providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}] 

从@angular/common

导入 locationStategry 和 HashLocationStatregry
import { LocationStrategy, HashLocationStrategy } from "@angular/common"