Renaming the index.html on Google App Engine

31 views
Skip to first unread message

Zachary Bessler

unread,
Nov 4, 2019, 9:46:53 AM11/4/19
to Google App Engine
Ok, let me 1st come clean.  I mistakenly added a 365d expiration date to my `index.html` file.  I've now made a change to a JS file, which changed the name of the import in my `index.html` and now it's trying to import the wrong file. Oops.

So I'm thinking let's change the name of the default file name to something else that isn't cached.

## What I have now ##

In my Angular project, I've changed all the building settings so now my `index.html` file is named `main.html`.  The even the file itself is named `main.html`, and checking in my dist folder, there is no `index.html` only a `main.html`.

I have hosted the site on Google App Engine and this is the command I used to deploy after building.

`gcloud app deploy app.yaml --quiet --project=<project-name>`

Here is my `app.yaml`
```
api_version: 1

env: standard
runtime: python27
service: <service-name>
threadsafe: yes

automatic_scaling:
  min_idle_instances: 1

handlers:

- url: /(.*\.(css|eot|gz|html|ico|js|map|png|jpg|jpeg|svg|ttf|woff|woff2|pdf|gif))
  static_files: dist/browser/\1
  upload: dist/browser/(.*\.(css|eot|gz|html|ico|js|map|png|jpg|jpeg|svg|ttf|woff|woff2|pdf|gif))
  expiration: "365d"

- url: /.*
  static_files: dist/browser/main.html
  upload: dist/browser/main.html
  secure: always
  expiration: "0s"

skip_files:
 ## bunch of files
```

## Problem: ##
It seems like Google is still serving up `index.html`, though to be honest I'm not really sure how to check.  How do tell it to serve up the `main.html` as the default file?

Elliott (Cloud Platform Support)

unread,
Nov 5, 2019, 7:27:04 PM11/5/19
to Google App Engine
Hello Zachary,

Please note that Google Groups are reserved for general Google Cloud Platform and product discussions and not for technical issues, which is why I suggest moving the troubleshooting to Stackoverflow, where you may receive advice from our programming community.

Reply all
Reply to author
Forward
0 new messages