Reading files from a directory inside a meteor app

后端 未结 7 597
既然无缘
既然无缘 2021-01-04 08:28

How can i read the public directory in a meteor application inside my /server path.

I tried using the native \'fs\' package but i keep getting a file/di

7条回答
  •  执笔经年
    2021-01-04 08:47

    This is no longer true. For Meteor 0.8, the folder "../client/app" is public. Thus, use fs.readdirSync('../client/app') to get files and folders in public.

    Source: personal experience and https://stackoverflow.com/a/18405793

提交回复
热议问题