Node - by default - when requiring anything, it looks for `${theThing}.js`, if it didn't find that, it looks for `${theThing}/index.js`
Examples:
require('./controllers/index.js'); // this would require exactly what you want
require('./controllers/index'); // this would look for the index.js otherwise it'd throw an error
require('./controllers'); // this would do the same as before
require('..'); // find the index.js in the parent folder
https://github.com/FACG6/CMSPosts/blob/6df00bcc761329d8e4c90eca4f5a99ebb70d379d/src/app.js#L8
Node - by default - when requiring anything, it looks for
`${theThing}.js`
, if it didn't find that, it looks for`${theThing}/index.js`
Examples:also also, https://github.com/FACG6/CMSPosts/blob/6df00bcc761329d8e4c90eca4f5a99ebb70d379d/src/database/queries/selectPostsViaUser.js#L1 You don't need to say
./..
,..
is just enough.