1 ##############################################################################
2 # Copyright (c) 2016 ZTE Corporation
3 # feng.xiaowei@zte.com.cn
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 from tornado.web import URLSpec, StaticFileHandler
11 from settings import default_settings, \
12 SWAGGER_API_DOCS, SWAGGER_API_LIST, SWAGGER_API_SPEC
13 from views import SwaggerUIHandler, SwaggerResourcesHandler, SwaggerApiHandler
16 def swagger_handlers():
17 prefix = default_settings.get('swagger_prefix', '/swagger')
22 return prefix + suffix
28 name=SWAGGER_API_DOCS),
31 SwaggerResourcesHandler,
33 name=SWAGGER_API_LIST),
38 name=SWAGGER_API_SPEC),
40 _path(r'(.*\.(css|png|gif|js))'),
42 {'path': default_settings.get('static_path')}),