diff --git a/app/__init__.py b/app/__init__.py index 1f14007..0ec4226 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -5,11 +5,12 @@ from flask_restx import Api from config import BASE_DIR, DATA_DIR, MONSTERS_JSON_PATH app = Flask(__name__) +app.url_map.strict_slashes = False # Because Chromium is being a bitch + CORS(app) restx_api = Api(app, version='1.0', title='Gamma World Dice', description='Rolled Dice As A Service') app.config['DEBUG'] = True -app.config.SWAGGER_UI_JSONEDITOR = True app.config['SWAGGER_UI_JSONEDITOR'] = True app.config['BASE_DIR'] = BASE_DIR app.config['DATA_DIR'] = DATA_DIR diff --git a/app/routes/roll_dice.py b/app/routes/roll_dice.py index 8145354..27b1aa8 100644 --- a/app/routes/roll_dice.py +++ b/app/routes/roll_dice.py @@ -15,7 +15,7 @@ parser.add_argument('geometry', type=int, required=True, help='Number of faces o parser.add_argument('discard_lowest', type=str_to_bool, required=True, help='Whether to discard lowest roll') -@namespace.route('/') # resolves to: /dice or /dice/ +@namespace.route('') # resolves to: /dice class RollDice(Resource): @namespace.expect(parser) def get(self): diff --git a/tests/test_routes/test_route_dice.py b/tests/test_routes/test_route_dice.py index e35c48a..ca2928c 100644 --- a/tests/test_routes/test_route_dice.py +++ b/tests/test_routes/test_route_dice.py @@ -1,7 +1,7 @@ import pytest from app import app -ROUTE = '/dice/' +ROUTE = '/dice' @pytest.fixture