Tuesday 24 October 2017

express.Router not working?

I'm trying to separate my application in two parts: admin and common users, so i've separated my routes:routes/ admin.js index.js And in my app.js file, i've set it like this:var app = express(); app.use("/admin", require("./routes/admin")); app.use("/index", require("./routes/index")); In my navbar, i have something like this:
  • Which is a common user link. But when i try to access it, it gives me the "cannot get /index/lemas" message. If i go to "/lemas", it will work.The same will happen if i try to access "/admin/noticias/new". But if i go to "noticias/new", it will work. What am i doing wrong here?

    Submitted October 24, 2017 at 04:28AM by jonnymous

No comments:

Post a Comment