Answer the question
In order to leave comments, you need to log in
Is it possible to use require to include all files from a folder at once?
Hello, is it possible to use require() or some other method
to connect all files from one folder at once?
I need it to immediately connect all the routes at once. Now I do it like this:
app.use([
require('./routes/home'),
require('./routes/auth'),
require('./routes/about'),
require('./routes/premium'),
])
app.use([
require('./routes'),
])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question