Merge branch 'development' of ssh://git.vsnt.uk:2222/viveksantayana/wanderhome-quiz into development

This commit is contained in:
2022-08-31 01:49:59 +01:00
4 changed files with 12 additions and 12 deletions

View File

@ -1,6 +1,6 @@
from .config import Development as Config
from .models import *
from .extensions import db
from .extensions import cors, db
from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
@ -10,6 +10,7 @@ def create_app():
app.config.from_object(Config())
app.wsgi_app = ProxyFix(app.wsgi_app, x_proto = 1, x_host = 1)
cors.init_app(app=app)
db.init_app(app=app)
from .views import views

View File

@ -1,2 +1,4 @@
from flask_cors import CORS
cors = CORS()
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()

View File

@ -10,11 +10,9 @@ views = Blueprint(
import_name=__name__
)
@views.route('/fetch/<string:data_type>/')
def _fetch(data_type):
if not check_file(f'{data_type}.json'): return abort(404)
if data_type == 'questions': return render_questions()
return load(f'{data_type}.json')
@views.route('/questions/')
def _questions():
return render_questions()
@views.route('/submit/', methods=['POST'])
def _submit():