node.js/angular.js - Cannot GET

前端 未结 4 1141
渐次进展
渐次进展 2021-02-07 11:22

I have the root route and it works fine. I also have a another route 127.0.0.1:3000/dashboard if I just type that url into the address bar I get this error:

Cannot GET /

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-07 12:09

    Route app.get('/index/dashboard', routes.dashboard); refers to http://hostname/index/dashboard whereas when('/dashboard', { ... }) refers to http://hostname/dashboard.

    You should correct the route: app.get('/dashboard', routes.dashboard);

提交回复
热议问题