Commit 0c0bc39c authored by Landon DeCoito's avatar Landon DeCoito

renamed app.py to __init__.py and changed start.sh to comply

parent 8e6136c7
# flask imports
from flask import Flask
from flask import Response
from flask import render_template
# app imports
from parscript import load_data
from getconnectedscript import load_getconn_data
# python imports
import json
app = Flask(__name__)
@app.route("/")
def display_default():
resp = Response(("Welcome to the masontoday API! Go to https://git.gmu.edu/srct/mason-today-web <br/><br/>"
+ "Feel free to go to /api/25live/ or /api/getconnected/ to find our api!").encode('utf-8'))
resp = render_template('welcomepage.html')
return resp
@app.route("/api/25live")
def display_data():
resp = Response(json.dumps(load_data(), ensure_ascii=False).encode('utf-8'))
resp = Response(json.dumps(load_data(), ensure_ascii=False)
.encode('utf-8'))
resp.headers['Content-Type'] = 'application/json; charset=utf-8'
return resp
@app.route("/api/getconnected")
def display_GC_data():
resp = Response(json.dumps(load_getconn_data(), ensure_ascii=False).encode('utf-8'))
resp = Response(json.dumps(load_getconn_data(), ensure_ascii=False)
.encode('utf-8'))
resp.headers['Content-Type'] = 'application/json; charset=utf-8'
return resp
#!/bin/sh
export FLASK_APP=mason-today/app.py
export FLASK_APP=mason-today/__init__.py
export FLASK_DEBUG=1
flask run
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment