finally solved the mystery of the forward-slash

This commit is contained in:
Greg Gauthier 2024-07-05 18:55:01 +01:00
parent d6fe2300a5
commit 3ed7f0879e
3 changed files with 4 additions and 3 deletions

View File

@ -5,11 +5,12 @@ from flask_restx import Api
from config import BASE_DIR, DATA_DIR, MONSTERS_JSON_PATH from config import BASE_DIR, DATA_DIR, MONSTERS_JSON_PATH
app = Flask(__name__) app = Flask(__name__)
app.url_map.strict_slashes = False # Because Chromium is being a bitch
CORS(app) CORS(app)
restx_api = Api(app, version='1.0', title='Gamma World Dice', description='Rolled Dice As A Service') restx_api = Api(app, version='1.0', title='Gamma World Dice', description='Rolled Dice As A Service')
app.config['DEBUG'] = True app.config['DEBUG'] = True
app.config.SWAGGER_UI_JSONEDITOR = True
app.config['SWAGGER_UI_JSONEDITOR'] = True app.config['SWAGGER_UI_JSONEDITOR'] = True
app.config['BASE_DIR'] = BASE_DIR app.config['BASE_DIR'] = BASE_DIR
app.config['DATA_DIR'] = DATA_DIR app.config['DATA_DIR'] = DATA_DIR

View File

@ -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') 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): class RollDice(Resource):
@namespace.expect(parser) @namespace.expect(parser)
def get(self): def get(self):

View File

@ -1,7 +1,7 @@
import pytest import pytest
from app import app from app import app
ROUTE = '/dice/' ROUTE = '/dice'
@pytest.fixture @pytest.fixture