add CORS rule for ANY origin
This commit is contained in:
parent
4dc0bb94b4
commit
4e9cd5593a
5
app.py
5
app.py
@ -1,4 +1,5 @@
|
|||||||
from flask import Flask
|
from flask import Flask
|
||||||
|
from flask_cors import CORS
|
||||||
from flask_restx import Api, Resource
|
from flask_restx import Api, Resource
|
||||||
from marshmallow import Schema, fields, validate
|
from marshmallow import Schema, fields, validate
|
||||||
from models import dice_model, ability_model, hp_model, character_model
|
from models import dice_model, ability_model, hp_model, character_model
|
||||||
@ -6,6 +7,8 @@ from mutations import Mutations
|
|||||||
import random
|
import random
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
CORS(app)
|
||||||
|
|
||||||
app.config.SWAGGER_UI_JSONEDITOR = True
|
app.config.SWAGGER_UI_JSONEDITOR = True
|
||||||
app.config['SWAGGER_UI_JSONEDITOR'] = True
|
app.config['SWAGGER_UI_JSONEDITOR'] = True
|
||||||
api = Api(app, version='1.0', title='Gamma World Dice', description='Rolled Dice As A Service')
|
api = Api(app, version='1.0', title='Gamma World Dice', description='Rolled Dice As A Service')
|
||||||
@ -273,7 +276,5 @@ def roll_mutations(conscore, intscore):
|
|||||||
return mutations_table
|
return mutations_table
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run()
|
app.run()
|
||||||
|
@ -2,3 +2,4 @@ Flask~=3.0.3
|
|||||||
flask-restx~=1.3.0
|
flask-restx~=1.3.0
|
||||||
marshmallow~=3.21.3
|
marshmallow~=3.21.3
|
||||||
pandas~=2.2.2
|
pandas~=2.2.2
|
||||||
|
flask-cors~=4.0.1
|
||||||
|
Loading…
Reference in New Issue
Block a user