initial commit
This commit is contained in:
commit
87d6c15dfe
19
.gcloudignore
Normal file
19
.gcloudignore
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# This file specifies files that are *not* uploaded to Google Cloud Platform
|
||||||
|
# using gcloud. It follows the same syntax as .gitignore, with the addition of
|
||||||
|
# "#!include" directives (which insert the entries of the given .gitignore-style
|
||||||
|
# file at that point).
|
||||||
|
#
|
||||||
|
# For more information, run:
|
||||||
|
# $ gcloud topic gcloudignore
|
||||||
|
#
|
||||||
|
.gcloudignore
|
||||||
|
# If you would like to upload your .git directory, .gitignore file or files
|
||||||
|
# from your .gitignore file, remove the corresponding line
|
||||||
|
# below:
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
# Python pycache:
|
||||||
|
__pycache__/
|
||||||
|
# Ignored by the build system
|
||||||
|
/setup.cfg
|
20
main.py
Normal file
20
main.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
from flask import Flask
|
||||||
|
|
||||||
|
|
||||||
|
# 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!'
|
||||||
|
|
||||||
|
|
||||||
|
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]
|
10
main_test.py
Normal file
10
main_test.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
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')
|
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Flask==1.0.2
|
||||||
|
requests==2.20
|
Loading…
Reference in New Issue
Block a user