node.js - how to define the file path in nodejs require('') with "../ " Notations? -
i having trouble in defining paths in nodejs.
i need define path ../../
don't understand how use ..
notations.
example:
var core=require('../../app/server/controllers');
in meanjs 0.3 worked good.
now changed mean 0.4 little different folder structure eating time define path.
could give helping explanation dot notation regarding path defining single .
?
aim define path of core/server/controller/core.server.controller.js
file in custom directory restaurants.server.controller.js
screenshot:
your restaurant.server.controller.js
in modules/restaurants/server/controllers
directory. ../
means go 1 directory, ../../../
(up 3 directories) put in /modules
. can find core.server.controller.js
following core/server/controllers
directories.
so final require want core is:
var core = require('../../../core/server/controllers/core.server.controller');
Comments
Post a Comment