How do I load the files under the specified folder when the project starts?

  node.js, question

I define a set of URLs and corresponding fn in different files by my own methods, and then throw them into the cache object so that http requests can find the allocation method directly to the corresponding path. However, how do I throw these data into the cache after the project starts?
Ps: Try not to use third-party packages …
I wrote a small tool that can traverse all js modules in the specified directory for loading, hoping to be helpful.