Adding API App route for index.

This commit is contained in:
Roland 2023-06-09 16:16:43 -06:00
parent 6ace7cc098
commit e5fe1b6bb9
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 5 additions and 1 deletions

View file

@ -109,6 +109,7 @@ index_html = '''
'''
@api_app.get('/')
@api_bp.get('/')
async def index(_):
return response.html(index_html)

View file

@ -6,7 +6,6 @@ from mock import mock
from wrolpi.admin import HotspotStatus
from wrolpi.common import get_config
from wrolpi.dates import strptime
from wrolpi.db import get_db_session
from wrolpi.downloader import Download, get_download_manager_config
from wrolpi.root_api import api_app
@ -24,6 +23,10 @@ class TestRootAPI(TestAPI):
assert response.status_code == HTTPStatus.OK
assert b'html' in response.body
request, response = api_app.test_client.get('/api')
assert response.status_code == HTTPStatus.OK
assert b'html' in response.body
def test_echo(self):
"""
Echo should send back a JSON object with our request details.