Hello Chris, while bundling several different services inside of a single 
App Engine version is possible, it is not the recommended way to build your 
application.

The recommended method is to instead use several independent services, each 
running on a sub-domain of your website, and to implement a Microservice 
architecture 
<https://cloud.google.com/appengine/docs/standard/php/microservices-on-app-engine>
.

That way you could have mywebsite.com be your SPA and api.mywebsite.com be 
your API. Would that suit your needs?

On Tuesday, January 16, 2018 at 10:57:32 AM UTC-5, Chris Fremgen wrote:
>
>
> My goal is to serve a SPA and PHP api on the same site. I would like to be 
> able to browse the website at mywebsite.com, and request api calls at 
> mywebsite.com/api/.
>
> My directory structure is:
>
> public
> |
> +-- index.html 
> +-- api
>      |
>      index.php
>
>
> My app.yaml:
>
> runtime: php
> env: flex
>
> runtime_config:
>   document_root: public
>
>
> Navigation to mywebsite.com gives a 404 because public/index.php doesn't 
> exist.
>
>
>
> So I tried this app.yaml:
>
> runtime: php
> env: flex
>
> runtime_config:
>   document_root: public
>   front_controller_file: index.html
>
>
> And I can access mywebsite.com normally since index.html is the default 
> file, but api/index.php is still 404.
>
>
> Is something like this possible on App Engine php flex? I've read the 
> docs, no mention on how to handle routing like this. 
> https://cloud.google.com/appengine/docs/flexible/php/configuring-your-app-with-app-yaml
>
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/18fa16ae-9503-4318-a147-427d6c898401%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [google-appengine... Chris Fremgen
    • [google-appe... 'Yannick (Cloud Platform Support)' via Google App Engine

Reply via email to