summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/tornado_swagger
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-05-12 18:33:00 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-05-17 16:43:12 +0800
commit74a3b45c290d1b6e289ac1c3b9425e804e2f0ab7 (patch)
tree905343c0fbd8114b1619641dcf359e2cd3fc1928 /testapi/opnfv_testapi/tornado_swagger
parentde3ac5fcdb1259df876df53d93b4166011fae79b (diff)
refactor static_path to accomodate web portal
move tornado_swagger/static to opnfv_testapi/static move swagger related 3rd libs to 3rd_party/swagger Change-Id: I32bba10584c99d13687b93f32577e37581db0c63 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/opnfv_testapi/tornado_swagger')
-rw-r--r--testapi/opnfv_testapi/tornado_swagger/handlers.py4
-rw-r--r--testapi/opnfv_testapi/tornado_swagger/settings.py5
-rw-r--r--testapi/opnfv_testapi/tornado_swagger/views.py2
3 files changed, 2 insertions, 9 deletions
diff --git a/testapi/opnfv_testapi/tornado_swagger/handlers.py b/testapi/opnfv_testapi/tornado_swagger/handlers.py
index c9c8a08..e39a9f6 100644
--- a/testapi/opnfv_testapi/tornado_swagger/handlers.py
+++ b/testapi/opnfv_testapi/tornado_swagger/handlers.py
@@ -35,8 +35,4 @@ def swagger_handlers():
views.SwaggerApiHandler,
settings.docs_settings,
name=settings.API_DECLARATION_NAME),
- (
- _path(r'(.*\.(css|png|gif|js|html|json))'),
- tornado.web.StaticFileHandler,
- {'path': settings.docs_settings.get('static_path')}),
]
diff --git a/testapi/opnfv_testapi/tornado_swagger/settings.py b/testapi/opnfv_testapi/tornado_swagger/settings.py
index 03e9bbd..2842261 100644
--- a/testapi/opnfv_testapi/tornado_swagger/settings.py
+++ b/testapi/opnfv_testapi/tornado_swagger/settings.py
@@ -6,17 +6,14 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-import os.path
API_DOCS_NAME = 'swagger-api-docs'
RESOURCE_LISTING_NAME = 'swagger-resource-listing'
API_DECLARATION_NAME = 'swagger-api-declaration'
-STATIC_PATH = os.path.join(os.path.dirname(os.path.normpath(__file__)),
- 'static')
docs_settings = {
'base_url': '',
- 'static_path': STATIC_PATH,
+ 'static_path': '',
'swagger_prefix': '/swagger',
'api_version': 'v1.0',
'swagger_version': '1.2',
diff --git a/testapi/opnfv_testapi/tornado_swagger/views.py b/testapi/opnfv_testapi/tornado_swagger/views.py
index 42b3748..7939997 100644
--- a/testapi/opnfv_testapi/tornado_swagger/views.py
+++ b/testapi/opnfv_testapi/tornado_swagger/views.py
@@ -33,7 +33,7 @@ class SwaggerUIHandler(tornado.web.RequestHandler):
def get(self):
resource_url = self.reverse_url(settings.RESOURCE_LISTING_NAME)
discovery_url = self.base_url + resource_url
- self.render('index.html', discovery_url=discovery_url)
+ self.render('swagger/index.html', discovery_url=discovery_url)
class SwaggerResourcesHandler(tornado.web.RequestHandler):