robin*

메인 js에서 routes 폴더 안의 파일들을 require

1 +const fs = require('fs');
2 +const path = require('path');
3 +const app = require('./server');
4 +
5 +fs.readdirSync(path.resolve(__dirname, 'routes')).forEach((name) => {
6 + require(path.resolve(__dirname, 'routes', name));
7 +});
...\ No newline at end of file ...\ No newline at end of file