简体   繁体   中英

Accessing static .obj files stored in GitHub LFS

I have a simple static app deployed to Heroku with a repo in GitHub. The static app essentially is an HTML page with some JavaScript that uses Three.js to render some very large .obj files to the HTML page. Given these are very large .obj files, I'm using GitHub LFS to store the files in the repo. I've validated that these files are being stored properly by LFS in my repo.

So within my JavaScript then, I have some code that's essentially the following:

loader.load('path/to/my/large-obj.obj', () => { ... });

This code works locally, but when I deploy the app to Heroku, none of the .obj files are loaded.

I inspected the Network tab to check to see if the .obj files are actually being fetched properly. The requests for the .obj files are returning 200's, but when I examine the response, instead of seeing the .obj file contents, I see this something like this:

version https://git-lfs.github.com/spec/v1
oid sha256:[some long shaw...]
size 5642808

Isn't this GitHub LFS's pointer to my .obj file? How can I fetch the actual .obj and not the pointer to the .obj?

Heroku doesn't support Git LFS :

git lfs is not supported, and using it might cause pushes to fail.

Do these files have to be in your repository? Storing them on Amazon S3 or similar should make Heroku happy. Maybe that needs to be part of your deployment strategy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM