Make it a server
This commit is contained in:
parent
f3349ae539
commit
1cb7d7242f
16
app.py
16
app.py
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue