mirror of
https://github.com/Xevion/power-math.git
synced 2025-12-06 15:15:55 -06:00
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:
@@ -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>')
|
||||
|
||||
Reference in New Issue
Block a user