added html template
This commit is contained in:
parent
87d6c15dfe
commit
d2520f701e
11
app.yaml
11
app.yaml
@ -1 +1,12 @@
|
|||||||
runtime: python37
|
runtime: python37
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- url: /static
|
||||||
|
static_dir: static
|
||||||
|
|
||||||
|
- url: /.*
|
||||||
|
script: auto
|
||||||
|
secure: always
|
||||||
|
|
||||||
|
manual_scaling:
|
||||||
|
instances: 1
|
||||||
|
12
main.py
12
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 = Flask(__name__)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def hello():
|
def hello():
|
||||||
"""Return a friendly HTTP greeting."""
|
return render_template('index.html')
|
||||||
return 'Hello World!'
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
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)
|
app.run(host='127.0.0.1', port=8080, debug=True)
|
||||||
# [END gae_python37_app]
|
# [END gae_python37_app]
|
||||||
|
10
main_test.py
10
main_test.py
@ -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
11
templates/index.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>sarsoo</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>sarsoo</h1>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user