So I know this isnt the express subreddit but hopefully there are some express users around. I have been struggling for this a bit and althought im a noob, i dont see why this doesnt work.//app.js var users = require("./routes/users.js"); ... app.use('/users', users); //users.js var express = require("express"); var router = express.Router(); router.get("/users",function(req,res){ console.log("Somebody listed all the users"); }); module.exports = router;
Submitted April 06, 2016 at 07:20PM by Jacobyy
No comments:
Post a Comment