Answer the question
In order to leave comments, you need to log in
Why is expressjs not seeing the path?
module.exports = (function(app){
var index = require('./index');
var users = require('./users');
app.use('/users', users);
app.use('/', index);
});
var express = require('express');
var router = express.Router();
router.get('/', function(req, res, next) {
console.log('index');
res.json({message: "index"});
});
module.exports = router;
var express = require('express');
var router = express.Router();
router.get('/users', function(req, res, next) {
console.log('users');
res.json({message: "users"});
});
module.exports = router;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question