pythongoogle-app-engineserving

How to serve Files in a Directory from App Engine Standard Python Environment


For a project, our team is using the app engine python environment to host several scripts that are scraping a website to store data in the form of various json files and directories of images. We want to expose these directories to a url (Ex: /img/01.jpg in the app engine directory to "sample.appspot.com/img/01.jpg"). The reason is that we want to be able to download these files directly to a react-native mobile app using the fetch api. Is this feasable, efficient, and quick using app engine and how? If not what combination of google cloud services could we use to achieve the same functionality and how?


Solution

  • You could use Google Cloud Storage to store your files:

    Once stored they're pretty much static files, so for serving them you have 2 options: