First, Build a site www.example.com
with Google App Engine https://cloud.google.com/products/
Second, Upload a static image example.jpg
to Google Cloud Storage https://cloud.google.com/products/cloud-storage aka https://developers.google.com/storage/
Is it possibe to serve the example.jpg
as http://www.example.com/images/example.jpg
? instead of using a subdomain such as images.example.com
or cdn.example.com
etc
The reason I want to do this is because I want to make it easier to move my site to a VPS when necessary.
You have setup Google Cloud Storage (GCS) https://cloud.google.com/products/cloud-storage aka https://developers.google.com/storage/
You could not serve your image
example.jpg
that uploaded to Google Cloud Storage (GCS) ashttp://www.example.com/images/example.jpg
when you have assigned yourwww.example.com
pointed other than GCS (c.storage.googleapis.com).If you insist to serve with the domain, you may consider to parsing the images in base64code when you could redirect
http://www.example.com/images/example.jpg
via.htaccess
to a dynamic file where you can put the code to print out the image on the fly like so:You may also consider to put your static files like js, html, css, etc in the bucket and access those files to act like a dynamic content via Google App Engine (GAE).
I don't believe so, no. A single domain name must route to either Google Cloud Storage or Google App Engine.
You could cheat, mind you. You could configure your app engine app to take all requests for, say "/images/X" and redirect them to images.example.com/X, or you could have your app read the data from GCS and feed it back to the user directly from app engine, but neither of those are a good solution.
If you wanted to move to a VPS later, you could perhaps configure the VPS to handle two domains, one for images and one for dynamic content.