Referencing the Meteor public directory in production


This Meteor app runs fine in local development where I have this server side method

availableImagesFilesNames: () => {
      const dir = '/Users/empl1/Documents/meteor/ais/ais2Dev/public';
      let filesystem = require("fs");
      let results = [];
      filesystem.readdirSync(dir).forEach(function (file) {
      return results;

What does need to be changed in the path so that after uploading the app to Galaxy it continues to work? thx


Have you taken a look at Meteor’s Assets docs? You might want to consider using the Assets API instead, and working within a /private directory. Then when you need to get the absolute path of your asset directory/subdirectory, you can use Assets.absoluteFilePath(assetPath) (which will work anywhere you deploy it).


The static assets are image files in my case. Having them in a private directory, wouldn’t that make them not “openly” available to the client and thus causing more network requests/traffic than having them in a public directory?