I am using Google App Engine with bottle.py and am trying to serve a static HTML file when a user visits /. To that end I have this in my main.py:
bottle = Bottle()
@bottle.route('/')
def index():
"""Serve index.html."""
return static_file('index.html', root='/static')
I also have the following in my app.yaml:
handlers:
- url: /favicon\.ico
static_files: static/favicon.ico
upload: static/favicon\.ico
- url: /static
static_dir: static
application-readable: true
- url: /.*
script: main.bottle
The favicon and a CSS file (both in the static directory) are used fine, although not served directly. However, going to / results in a 404 error. I'm slightly confused about what I should be doing with bottle.route and what I should be doing in app.yaml.
For completeness, my directory structure looks like this:
src
+-- main.py
+-- app.yaml
+-- static
+-- favicon.ico
+-- index.html
+-- stylesheet.css
+-- [other unimportant files]