[英]How do you access cloud storage images via local GAE development server?
I can't figure out how to generate image urls in the local development server. 我不知道如何在本地开发服务器中生成图像URL。 In production I can use
在生产中我可以使用
CloudStorageTools::getImageServingUrl("gs://example/path/to/image.jpg")
but when I use the same line using the development server, it generates 但是当我在开发服务器上使用同一行时,它会生成
http://localhost:24080/_ah/img/encoded_gs_file:d2lsZHN0YXItZGF0YS9pbWFnZXMvdGVzdC9tZTMuanBlZw==
instead of a actual url to a image. 而不是图片的实际网址。 I'll have a large set of images and they are best suited to be stored with cloud stage instead of the app engine app.
我将拥有大量图像,它们最适合存储在云平台而不是App Engine应用程序中。
The local dev_appserver uses local file system to emulate GCS. 本地dev_appserver使用本地文件系统来模拟GCS。 That's why the URL you get from getImageServingUrl only works on your local machine.
这就是为什么从getImageServingUrl获得的URL仅在本地计算机上可用的原因。 You'll get a publicly accessible URL when running the app in production.
在生产环境中运行应用程序时,您将获得一个可公开访问的URL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.