add the forward-slash back to the flask app. Something on the front end keeps inserting it :(

This commit is contained in:
Greg Gauthier 2024-07-04 08:18:12 +01:00
parent 0650c89109
commit 91b610c342
3 changed files with 6 additions and 3 deletions

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')
@namespace.route('') # resolves to: /dice
@namespace.route('/') # resolves to: /dice or /dice/
class RollDice(Resource):
@namespace.expect(parser)
def get(self):

View File

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

View File

@ -12,7 +12,10 @@ window.onload = function () {
discard_lowest: discard
});
fetch(`${window.BASE_URL}/dice?${queryParams}`)
const urlToFetch = `${window.BASE_URL}/dice?${queryParams}`;
console.log(`URL to fetch: ${urlToFetch}`);
fetch(urlToFetch)
.then(response => response.json())
.then(data => {
const resultsDiv = document.getElementById('results');