diff --git a/app.yaml b/app.yaml index a0b719d..13c82e1 100644 --- a/app.yaml +++ b/app.yaml @@ -1 +1,12 @@ runtime: python37 + +handlers: +- url: /static + static_dir: static + +- url: /.* + script: auto + secure: always + +manual_scaling: + instances: 1 diff --git a/main.py b/main.py index ebb1405..9d12b0e 100644 --- a/main.py +++ b/main.py @@ -1,20 +1,12 @@ -from flask import Flask +from flask import Flask, render_template - -# If `entrypoint` is not defined in app.yaml, App Engine will look for an app -# called `app` in `main.py`. app = Flask(__name__) @app.route('/') def hello(): - """Return a friendly HTTP greeting.""" - return 'Hello World!' - + return render_template('index.html') if __name__ == '__main__': - # This is used when running locally only. When deploying to Google App - # Engine, a webserver process such as Gunicorn will serve the app. This - # can be configured by adding an `entrypoint` to app.yaml. app.run(host='127.0.0.1', port=8080, debug=True) # [END gae_python37_app] diff --git a/main_test.py b/main_test.py deleted file mode 100644 index d0e43e6..0000000 --- a/main_test.py +++ /dev/null @@ -1,10 +0,0 @@ -import main - - -def test_index(): - main.app.testing = True - client = main.app.test_client() - - r = client.get('/') - assert r.status_code == 200 - assert 'Hello World' in r.data.decode('utf-8') diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..3b0f90a --- /dev/null +++ b/templates/index.html @@ -0,0 +1,11 @@ + + +
+