简体   繁体   English

找不到express.js文件

[英]express.js file not found

I am new to express/node.js and I am having trouble finding the page at localhost:3000/info 我是Express / node.js的新手,在localhost:3000 / info找不到页面

The images of my code are linked below 我的代码的图像在下面链接

app.js

index.js

I believe the problem is that you indeed create a route for the info page, but as far as I can see in the images you never tell express to use that route... 我相信问题是您确实为信息页面创建了一条路线,但是据我所见,您从未告诉过表达使用该路线的图像...

var infoRouter = require=('./routes/info');


app.use(inforRouter);

The first line is for loading the module, and the second one is for its execution 第一行用于加载模块,第二行用于执行模块

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM