AngularJS - html5Mode - Cannot GET /login

前端 未结 6 985
感动是毒
感动是毒 2020-12-31 12:07

Hi have created one angularJS application with yeoman, grunt and bower. I have enabled the html5Mode for the application. And its working. But, when I refresh a page (localh

6条回答
  •  旧巷少年郎
    2020-12-31 12:33

    add this code in server.js after all the routes

    app.use('/*',function(req, res) {
        res.sendfile(__dirname + '/public/index.html');
    });
    

提交回复
热议问题