-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.py
45 lines (34 loc) · 1.03 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#import necessary libraries
from flask import Flask, render_template, redirect
from flask import Flask, jsonify
from flask_restful import Resource, Api, reqparse
from google.cloud import bigquery
import os
# import otherroute! which is another py file
try:
# The typical way to import flask-cors
from flask_cors import CORS
except ImportError:
# Path hack allows examples to be run without installation.
import os
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0, parentdir)
from flask_cors import CORS
#create Flask app instance
app = Flask(__name__)
api = Api(app)
# cors=CORS(app, resources=r'smallSst.json', allow_headers='Content-Type')
@app.route("/")
# @cross_origin()
def index():
return render_template("index.html")
@app.route("/data")
# @cross_origin()
def data():
return render_template("data.html")
@app.route("/cost")
# @cross_origin()
def cost():
return render_template("cost.html")
if __name__ == '__main__':
app.run(debug=True, port = 1123)