node.js的快速刷新页面无法呈现有角子路由器页面

时间:2018-09-27 07:41:43

标签: node.js angular express

node.js在public文件夹中设置静态路径,并在public文件夹中进行角度构建:

app.use(express.static(path.join(__dirname, 'public')));

角路由器:

{ path: '', redirectTo: '/index', pathMatch: 'full'},
    { path: '/index', component: IndexComponent,children: [
        { path: '', redirectTo: 'apage', pathMatch: 'full'},
        { path: '/apage', component: /apage},
        { path: '/bpage', component: /bpage}

http://localhot:3000/中工作的node.js服务器可以连接http://localhot:3000/indexpublic/index.html)时。

当您重新刷新(F5)http://localhot:3000/index页面时,将从快速路由器错误消息中找不到错误信息页面。

快速路由器无法识别路由器/index/index/apage/index/bpage ...等,这是角形子路由器。

刷新网页时如何呈现子页面。子页面不是单独的页面,render方法与express不同。

0 个答案:

没有答案
相关问题