Access files for Meteor applications outside its root directory

The goal is to access the image library outside the meteor shower catalog. This is because the application will not be the only component using the specified lib. The meteor application, images lib and other components will be on the same machine.

How can i do this? And is there such a thing called a local content delivery network?

+1
source share
1 answer

At the same time, you need two different things.

For the first part , to read / write access to your files outside the meteor directory, see fooobar.com/questions/1238271 / ... and http://shiggyenterprises.wordpress.com/2013/05/16/accessing-the-file -system-in-meteor / , which basically tells you to use fs from npm

 @fs = Npm.require 'fs' @path = Npm.require 'path' readSomeFile = () -> p = path.resolve './server/somefile.csv' data = fs.readFileSync p, 'UTF-8' #... 

the second part is designed to serve these images from an alternative web server, which you can use with any web server module from node or apache / nginx, which uses the target directory as its docbase.

You can even do this from within a meteorite, but a meteorite is not the best web server for serving static assets.

0
source

Source: https://habr.com/ru/post/1238267/


All Articles