【发布时间】:2018-06-25 06:59:32
【问题描述】:
我的目标是在同一个站点上提供 SPA 和 PHP api。我希望能够在 mywebsite.com 上浏览网站,并在 mywebsite.com/api/ 上请求 api 调用。
我的目录结构是:
public
|
+-- index.html
+-- api
|
index.php
我的 app.yaml:
runtime: php
env: flex
runtime_config:
document_root: public
导航到 mywebsite.com 会出现 404,因为 public/index.php 不存在。
所以我尝试了这个 app.yaml:
runtime: php
env: flex
runtime_config:
document_root: public
front_controller_file: index.html
而且我可以正常访问mywebsite.com,因为index.html是默认文件,但是api/index.php仍然是404。
在 App Engine php flex 上可以实现这样的事情吗?我已经阅读了文档-https://cloud.google.com/appengine/docs/flexible/php/configuring-your-app-with-app-yaml
谢谢!
【问题讨论】:
标签: google-app-engine app-engine-flexible google-app-engine-php