Coming from Django I'm accustomed to serving my static assets and media (including uploads) separately from the main wsgi or other app. This flat file structure is easy to navigate and manage.
I can't seem to find any examples of how to do this (serve static assets/media separately) with Meteor.
Is there a standard approach?
Are there packages that provide this functionality?
My end goals are:
to be able to more intuitively navigate all the static assets and media and access them from a publicly accessible URL without having to hot rebuild the meteor app. The "public" folder doesn't do it for me... especially for uploaded media.
upload to this system path (which is separate from the main meteor app) either manually when migrating an app or via a custom app/package I write.
browse/parse the path from meteor app/package
If you would want this for performance and scalability reasons (see my comment) you should go with a Caching Proxy. Initially the proxy will fetch a static file from the Meteor app directly, but subsequent requests will be served from its cache.
This article (nginx-caching) is a good read about how to set-up a caching proxy with Nginx in general. Also, Meteorpedia has an article explaining how to setup an Nginx cache specifically tailored for a Meteor app.
If all your static assets have a common path, for instance /static/...
, then you can tell nginx
to alias
requests to that path with a directory
location /static {
alias /path/to/static/assets;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With