-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the GCP deployment test to the repo
- Loading branch information
Showing
7 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
runtime: python37 | ||
|
||
handlers: | ||
# This configures Google App Engine to serve the files in the app's static | ||
# directory. | ||
- url: /static | ||
static_dir: static | ||
|
||
# This handler routes all requests not caught above to your main app. It is | ||
# required when static routes are defined, but can be omitted (along with | ||
# the entire handlers section) when there are no static files defined. | ||
- url: /.* | ||
script: auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import datetime | ||
|
||
from flask import Flask, render_template | ||
|
||
app = Flask(__name__) | ||
|
||
|
||
@app.route('/') | ||
def root(): | ||
# For the sake of example, use static information to inflate the template. | ||
# This will be replaced with real information in later steps. | ||
dummy_times = [datetime.datetime(2018, 1, 1, 10, 0, 0), | ||
datetime.datetime(2018, 1, 2, 10, 30, 0), | ||
datetime.datetime(2018, 1, 3, 11, 0, 0), | ||
] | ||
|
||
return render_template('index.html', times=dummy_times) | ||
|
||
|
||
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. | ||
# Flask's development server will automatically serve static files in | ||
# the "static" directory. See: | ||
# http://flask.pocoo.org/docs/1.0/quickstart/#static-files. Once deployed, | ||
# App Engine itself will serve those files as configured in app.yaml. | ||
app.run(host='127.0.0.1', port=8080, debug=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Flask==1.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
window.addEventListener('load', function () { | ||
|
||
console.log("Hello World!"); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
body { | ||
font-family: "helvetica", sans-serif; | ||
text-align: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Datastore and Firebase Auth Example</title> | ||
<script src="{{ url_for('static', filename='script.js') }}"></script> | ||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"> | ||
</head> | ||
<body> | ||
|
||
<h1>Datastore and Firebase Auth Example</h1> | ||
|
||
<h2>Last 10 visits</h2> | ||
{% for time in times %} <p>{{ time }}</p> | ||
{% endfor %} | ||
</body> | ||
</html> |