Meteor and the /private directory

前端 未结 1 1291
执念已碎
执念已碎 2020-12-17 06:27

I\'m using the /private directory in Meteor 1.0.3 at the moment to store and serve up pdf documents to the browser.

As an example, I have a folder struc

1条回答
  •  一向
    一向 (楼主)
    2020-12-17 07:04

    In order to keep from:

    (1) overwriting/removing the directory structure every time I deployed and,

    (2) restarting the Meteor application every time I created a directory or file.

    I decided in my case it just made sense to use a directory structure outside of the Meteor project instead of inside as before.

    Something like Dropbox/users/user-name, or anything really.

    I now believe that the /private and /public folders are more for static content than anything else.

    I'm not really storing that many files yet, and some of them are only temporary anyhow, so this method will hold me over until I move to something like S3.

    Please note:

    (1) You need to give your Meteor user permissions to access the outside-the-project directory.

    (2) Consider that this will take up space on your OS Instance HD.

    (3) You'll need to use Node.js for file system calls. These calls are not wrapped in Meteor Fibers, so you're on your own in terms of async/sync programming.

    0 讨论(0)
提交回复
热议问题