Now that it is possible to make non-container-bound webapps, it would make sense to be able to put the app's resources (e.g. some icons and images, perhaps a legacy database etc) into the app - perhaps in a similar way that you can add further .gs files to a project. This would mean they don't have to be uploaded to some external service and then referenced, and the web-app would be self-contained. Is there already a way to do this, or should I put in a feature request?
What works quite well for me is putting the Google Apps Script into a folder within Google Drive and adding all other resources to that folder. You can then link to them directly by using the download link if you share them with anyone having the link.
E.g. a file with ID ID
can be linked to via https://docs.google.com/uc?export=download&id=ID
. You can even link to certain revisions (click right on the file in Google Drive and open the revisions dialog to find out the revision key, then add &revid=REVISION_TOKEN
to your URL).
Its not 100% self-contained in a sense you can just copy all resources over somewhere and have it working in a dash, but the beauty of this solution is that the hosting is provided by Google and is most likely to have about the same availability as your Google Apps Script as well.
Almost ten years later the situation is almost the same about keeping together the related resources of a Google Apps Script web-application, we still have to store resources in another place but there are a lot of changes that might be worthy to consider.
It is still possible to link files stored in Google Drive by using URLs like https://docs.google.com/uc?export=download&id=ID
/ https://docs.google.com/uc?export=view&id=ID
but Google Drive have limits about how many "hits" could have a file. For low-users web-apps it's very likely that this will not be a problem.
Now Google Apps Script projects could be linked to Google Cloud Standard Projects. This is necessary to customize the OAuth Consent Screen and in order to be able to use some features of Google services. It might be worthy to review the Google Cloud file hosting services including Firebase.
By the way there are some things that are no longer available
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