를 사용왜 필요합니까 및 fs.existSync 내가 여기에이 코드가 다른 상대 경로
if(fs.existsSync('./example/example.js')){
cb(require('../example/example.js'));
}else{
cb();
}
왜 fs.existSync
require
가 아닌 다른 디렉토리를 사용되어야한다?
이
\example
example.js
\routes
index.js <-- this is the one where I am using this code
app.js <-- this one requires index.js and calls its functions using app.get('/example',example.index);
나는 '가까운'표를 이해하지 못한다. 적절한 질문이라고 생각한다. – robertklep
올바른 질문입니다. – FabianCook