In express.js I can write a controller that:
- accesses the file system
- reads the contents of a directory, and
- sends that information as a local variable to the view.
I'm not sure how to go about this in nuxt.js because I can't require the fs
module from the component. Is there anywhere where I can populate a variable with a list of files in the server (for example, in the static
folder) so that the component has access to it?
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1662">#c1662</a>)</em></sub></div>