在js页中加入接口
module.exports = router;
在app.js页中
1.加入类似
var indexRouter = require('./routes/index');
的对应值
2.加入类似
app.use('/', indexRouter);
的对应值。
对于我等windows用户来说,设置localhost访问端口的指令为 set port=3000 (端口号可以自己设置,我这里设置的是3000)
在js页中加入接口
module.exports = router;
在app.js页中
1.加入类似
var indexRouter = require('./routes/index');
的对应值
2.加入类似
app.use('/', indexRouter);
的对应值。
对于我等windows用户来说,设置localhost访问端口的指令为 set port=3000 (端口号可以自己设置,我这里设置的是3000)