Reputation: 4264
I have the below project structure. I am trying to access db.js inside CategoryController.js.
I have used the code below.
var db = require('./../routes/db');
when I'm trying to run the Node.js project using npm start it is showing the error below.
Upvotes: 1
Views: 58
Reputation: 1413
Try below
var db = require('./../db.js');
as the db.js
file is just out of controllers folder
Upvotes: 4