【发布时间】:2014-07-24 05:44:23
【问题描述】:
我想在 Google Cloud(Google App Engine 和 Restler RESTful API 服务器)上创建一个带有子域的网站:
http://api.restlerongooglecloud.com 用于混合应用(Android、iOS、Windows)joomla.restlerongooglecloud.com 用于博客,restlerongooglecloud.com 用于主页。
我想知道是否可以使用 GoogleAppEngine SDK 创建/准备网站以使用 Restler,然后将其作为指向 http://api.restlerongooglecloud.com 的实时网站上传到 Google App Engine。
Restler 使用 Composer 管理其依赖项,因此需要将 composer.phar 保存在项目文件夹中,最好保存在 usr/local/bin 中。
我的问题是,在本地机器上按照 Restler 文档进行所有设置并测试工作正常后,如果我将项目上传到 Google 云应用引擎,它会工作吗?
参考资料:
在 Google App Engine Launcher(平台 Windows8)上,当我指向 url 时出现以下错误:
hxxp: // localhost:10085/api/public/examples/_001_helloworld/say/hello
{ "error": { "code": 404, "message": "Not Found" }, "debug": { "source": "Routes.php:359 at route stage", "stages": { "success": [ "get" ], "failure": [ "route", "negotiate", "message" ] } } }
如何解决这个问题?
app.yaml 如下:
application: restlerongae
version: 1
runtime: php
api_version: 1
handlers:
## api images
- url: /api/(.*\.(ico$|jpg$|png$|gif$))
static_files: api/\1
upload: api/(.*\.(ico$|jpg$|png$|gif$))
application_readable: true
## api html
- url: /api/(.*\.(htm$|html$|css$|js$))
static_files: api/\1
upload: api/(.*\.(htm$|html$|css$|js$))
application_readable: true
## api test1
- url: /api/(.*)
script: api/public/examples/_001_helloworld/index.php
【问题讨论】:
-
@KrupaPatel,您在编辑帖子时应该更加小心。仅添加代码格式框不会使帖子更好。编辑时慢慢来,不要做马虎的工作。
-
为什么不直接上传看看呢?
-
我尝试上传 Restler 3 RC5 但无法正确配置
app.yml。
标签: php android google-app-engine restler