node.js express.js routing of root Redirecting to //

为君一笑 提交于 2020-01-05 14:10:52

问题


I want to route root route (http://server:5000/) in my node.js express.js application:

When I go to http://server:5000/ I get: Redirecting to //

I get the same message if I have a route:

app.get('/', routes.index);

What can be the problem?


回答1:


This was a bug in Windows with Connect: https://github.com/senchalabs/connect/issues/427

You should update or set the redirect option to false in the Connect static middleware.



来源:https://stackoverflow.com/questions/8648581/node-js-express-js-routing-of-root-redirecting-to

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!