added html template

This commit is contained in:
aj 2019-02-07 11:50:42 +00:00
parent 87d6c15dfe
commit d2520f701e
4 changed files with 24 additions and 20 deletions

View File

@ -1 +1,12 @@
runtime: python37
handlers:
- url: /static
static_dir: static
- url: /.*
script: auto
secure: always
manual_scaling:
instances: 1

12
main.py
View File

@ -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]

View File

@ -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')

11
templates/index.html Normal file
View File

@ -0,0 +1,11 @@
<!doctype html>
<html>
<head>
<title>sarsoo</title>
</head>
<body>
<h1>sarsoo</h1>
</body>
</html>