Deploying golang backend service and polymer frontend to google appengine

165 views
Skip to first unread message

vinoo.ne...@gmail.com

unread,
Feb 24, 2017, 11:26:23 AM2/24/17
to google-appengine-go
I'm kind of a newbie to appengine. I'm having trouble deploying an application that has a golang backend service and polymer frontend.

I was using https://github.com/googlesamples/cloud-polymer-go as my reference.

Here is the structure of my directory

guestbook
       backend\
                       app.yaml   
                       *.go
       frontend\
                       app.yaml
                       src\..
                       index.html

backend/app.yaml
---------------------------
application: my-project-id
module: default
....

handlers:
- url: /_cloudshellProxy/_cloudshellProxy/_ah/spi/.*
  script: _go_app
  secure: always

frontend/app.yaml
---------------------------
application: scrapbook-157319
module: frontend /* was added later on. Please see my comments below */
....
handlers:
- url: /bower_components
  static_dir: bower_components
  secure: always
..
- url: /
  static_files: index.html
  upload: index.html
  secure: always

Here are the commands I ran,

goapp serve backend/app.yaml
goapp serve frontend/app.yaml
appcfg.py -A my-project-id update_dispatch .

Backend was working correctly when I only had the backend service deployed. I was able to access http://my-project-id.appspot.com/_ah/api/explorer which used to redirect me to endpoint service page which provided access to the services and test it. Also verified that the service can be accessed via curl as follows 'curl https://my-project-id.appspot.com/_ah/api/topics/v1/topics -X GET -H "Accept: application/json"'

Then I accidentally deployed the frontend without specifying a module name. Now I have the following problem. 

Q1 After deploying the frontend, I'm not able to get to the services page instead I'm taken to the frontend's index.html page. Tested with curl to confirm that the service is not working. Is there a way I can undo the frontend deployment completely for default module?  How do I get past this issue? 

Q2 Tried redeploying the frontend application after adding module: 'frontend' to app.yaml. With this step, I'm able to access the frontend application as https://frontend-dot-myproject-id.appspot.com. But backend is still NOT working..Tested with curl to confirm that the service is not accessible. 

Q3. I tried redeploying the backend after incrementing the version. To my surprise when I'm accessing new version of the service, I'm still seeing the frontend application index.html. Is there some caching. What is causing the front app to show up eventhough I only deployed the backend?  
Note: I migrated the traffic to the new service and also deleted the older version.

Appreciate your help in advance.

Reply all
Reply to author
Forward
0 new messages