Reputation: 61
I'm new to GoogleCloud. I've followed the tutorial (for Node.js) with these steps:
It works fine as https://My-Hello-World.appspot.com
Build my own EndPoints APIs with project-id as My-Hello-World
My problem is the moment I deploy EndPoints APIs, my My-Hello-World.appspot.com doesn't run as webapp anymore, it responses as APIs. How to config to make my project run for both webapp and api when deploy to AppEngine?
https://My-Hello-World.appspot.com --> run as webapp
https://My-Hello-World.appspot.com/api/test/* --> run as api
Thank you.
Upvotes: 1
Views: 85
Reputation: 11
So assuming that
app.yaml
You can deploy them to the same project's app engine and have them run together as separate services. All you will need to do is add a service tag in your app.yaml
service: api
runtime: nodejs
env: flex
env_variables:
NODE_ENV : staging
This is what mine looks like for a ExpressJS RestAPI that I deploy to staging.
You can keep the web-app's app.yaml
the same, because it will be used as the default service.
Then you will be able to access
Reference
Upvotes: 1