diff options
Diffstat (limited to 'testapi/opnfv_testapi')
-rw-r--r-- | testapi/opnfv_testapi/resources/ui_handlers.py | 14 | ||||
-rw-r--r-- | testapi/opnfv_testapi/router/url_mappings.py | 2 | ||||
-rw-r--r-- | testapi/opnfv_testapi/tornado_swagger/handlers.py | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/testapi/opnfv_testapi/resources/ui_handlers.py b/testapi/opnfv_testapi/resources/ui_handlers.py new file mode 100644 index 0000000..ac8f816 --- /dev/null +++ b/testapi/opnfv_testapi/resources/ui_handlers.py @@ -0,0 +1,14 @@ +from opnfv_testapi.resources.handlers import GenericApiHandler +from opnfv_testapi.tornado_swagger import settings + + +class UIHandler(GenericApiHandler): + def initialize(self, **kwargs): + self.static_path = settings.docs_settings.get('static_path') + self.base_url = 'http://localhost:8000' + + def get_template_path(self): + return self.static_path + + def get(self): + self.render('testapi-ui/index.html') diff --git a/testapi/opnfv_testapi/router/url_mappings.py b/testapi/opnfv_testapi/router/url_mappings.py index 39cf006..94e71c6 100644 --- a/testapi/opnfv_testapi/router/url_mappings.py +++ b/testapi/opnfv_testapi/router/url_mappings.py @@ -12,9 +12,11 @@ from opnfv_testapi.resources import project_handlers from opnfv_testapi.resources import result_handlers from opnfv_testapi.resources import scenario_handlers from opnfv_testapi.resources import testcase_handlers +import opnfv_testapi.resources.ui_handlers mappings = [ # GET /versions => GET API version + (r'/', opnfv_testapi.resources.ui_handlers.UIHandler), (r"/versions", handlers.VersionHandler), # few examples: diff --git a/testapi/opnfv_testapi/tornado_swagger/handlers.py b/testapi/opnfv_testapi/tornado_swagger/handlers.py index fff6d21..c9c8a08 100644 --- a/testapi/opnfv_testapi/tornado_swagger/handlers.py +++ b/testapi/opnfv_testapi/tornado_swagger/handlers.py @@ -36,7 +36,7 @@ def swagger_handlers(): settings.docs_settings, name=settings.API_DECLARATION_NAME), ( - _path(r'(.*\.(css|png|gif|js))'), + _path(r'(.*\.(css|png|gif|js|html|json))'), tornado.web.StaticFileHandler, {'path': settings.docs_settings.get('static_path')}), ] |