Make it a server

This commit is contained in:
Robbe Van Herck 2020-05-13 02:50:14 +02:00
parent f3349ae539
commit 1cb7d7242f
2 changed files with 21 additions and 1 deletions

16
app.py
View File

@ -3,6 +3,13 @@ from httplib2 import Http
from google.oauth2 import service_account
import json
# Flask shizzle
from flask import Flask
from flask_cors import CORS, cross_origin
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
import configparser
CONFIG = configparser.ConfigParser()
CONFIG.read("config.ini")
@ -56,4 +63,11 @@ def create_point(row):
}
}
print(google_sheet_to_json())
@app.route('/data.json')
@cross_origin()
def data_json():
return google_sheet_to_json()
if __name__ == "__main__":
app.run()

View File

@ -1,6 +1,8 @@
cachetools==4.1.0
certifi==2020.4.5.1
chardet==3.0.4
click==7.1.2
Flask==1.1.2
google-api-core==1.17.0
google-api-python-client==1.8.2
google-auth==1.14.3
@ -8,6 +10,9 @@ google-auth-httplib2==0.0.3
googleapis-common-protos==1.51.0
httplib2==0.17.3
idna==2.9
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
protobuf==3.11.3
pyasn1==0.4.8
pyasn1-modules==0.2.8
@ -17,3 +22,4 @@ rsa==4.0
six==1.14.0
uritemplate==3.0.1
urllib3==1.25.9
Werkzeug==1.0.1