Updated API path

This commit is contained in:
Vivek Santayana 2022-08-31 00:49:00 +01:00
parent ce4694830d
commit cadccf1a53

View File

@ -2,7 +2,6 @@ import requests
from typing import Union from typing import Union
SERVER = 'http://127.0.0.1:5000/' SERVER = 'http://127.0.0.1:5000/'
FETCH_PATH = 'api/fetch/'
INSTRUCTIONS = [ INSTRUCTIONS = [
'---- Instructions ----', '---- Instructions ----',
@ -83,7 +82,7 @@ def validate_answer(answers:list, question:dict) -> bool:
def render_questions() -> dict: def render_questions() -> dict:
answers = [] answers = []
try: try:
questions = requests.get(url=f'{SERVER}{FETCH_PATH}questions/').json() questions = requests.get(url=f'{SERVER}/api/questions/').json()
except Exception as exception: except Exception as exception:
print(exception) print(exception)
quit() quit()