remove simplify frac text, add CORS fix for Vue port 8080 usage, fix swapped response & response code in API question generation

This commit is contained in:
Xevion
2020-12-13 17:43:27 -06:00
parent 714d5b6f7b
commit 4bc226713a
5 changed files with 9 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ The main app creation, registering extensions, API routes, the Vue.js catch all
from flask import Flask, render_template, jsonify
from flask_restful import Api
from flask_cors import CORS
from server import exceptions
from server.api import Question, Questions, Category, Categories
@@ -19,6 +20,9 @@ def create_app(env=None):
template_folder="./../dist"
)
# Add CORS support
cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
# Instantiate Flask-Restful API and register appropriate routes
api = Api(app, prefix='/api/')
api.add_resource(Question, '/question/', '/question/<string:question_id>')