finally solved the mystery of the forward-slash
This commit is contained in:
parent
d6fe2300a5
commit
3ed7f0879e
@ -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
|
||||||
|
@ -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):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from app import app
|
from app import app
|
||||||
|
|
||||||
ROUTE = '/dice/'
|
ROUTE = '/dice'
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
Loading…
Reference in New Issue
Block a user