How to use Python 3 with Google App Engine (GAE) and

I have been trying unsuccessfully to get a web app working with GAE, their python37 runtime, and
Here’s my

import bottle
from import ndb

app = bottle.default_app()
client = ndb.Client()

def ndb_wsgi_middleware(wsgi_app):
    def middleware(environ, start_response):
        with client.context():
            return wsgi_app(environ, start_response)
    return middleware

app = ndb_wsgi_middleware(app)

def test():
    return '<p><span style="color:green;">Good Test</span></p>'

And this my app.yaml:

runtime: python37

    - url: /test
      script: auto

    - url: /
      static_files: static/index.html
      upload: static/index.html

    - url: /
      static_dir: static

When I visit and other static pages it works fine, but when I visit it gives me a 502.

Can anyone help or direct me to a working example?