Srikanth
Srikanth

Reputation: 117

Google App Engine - How to add static files to a war folder of a running GAE application without a redeploy

I am trying to create an application where I host a few static html files that a user authors and uploads to GAE.

Is it possible to upload these files to WAR folder for hosting without a redeploy.

Uploading to WAR may not be a good idea as a redeploy would wipe out the user authored files. Would like these files to be stored across deployments.

May be a GCS bucket ? But in case of GCS bucket, how would you serve these static html files over a GAE/page.html url ?

I was reading that GCS bucket would serve as a web folder by turning a knob on that bucket. But how scalable would that be ? Is that even a good approach to use GCS bucket as a web url ?

Would be good to get some ideas on addressing this as I am new to GAE ! Thanks a lot

Upvotes: 0

Views: 130

Answers (1)

Alexander Trakhimenok
Alexander Trakhimenok

Reputation: 6268

You can use Google Cloud Storage to serve static websites and a Google AppEngine application to update the bucket when user edit/upload some content to the website.

You would probably need to have different subdomains for this like:

  • www.example.com - GCS
  • admin.example.com - GAE app that manages uploading/editing files using GCS API.

This should be pretty scalable & cheap to serve traffic.

Apart from GCS you also can considering storing static files on Amazon S3 or any other hosting that has API. Actually you even can develop a solution that upload files to multiple storages like GCS, S3, etc. and serve them using fault-tolerant DNS or reverse-proxy (like CloudFlare) so if Google or Amazon goes down your website is up and running.

Upvotes: 2

Related Questions