MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / static_routes

Function static_routes

pywebio/platform/aiohttp.py:159–169  ·  view source on GitHub ↗

获取用于提供PyWebIO静态文件的aiohttp路由列表 Get the aiohttp routes list for PyWebIO static files hosting. :param str prefix: The URL path of static file hosting, the default is the root path ``/`` :return: aiohttp routes list

(prefix='/')

Source from the content-addressed store, hash-verified

157
158
159def static_routes(prefix='/'):
160 """获取用于提供PyWebIO静态文件的aiohttp路由列表
161 Get the aiohttp routes list for PyWebIO static files hosting.
162
163 :param str prefix: The URL path of static file hosting, the default is the root path ``/``
164 :return: aiohttp routes list
165 """
166 files = [os.path.join(STATIC_PATH, d) for d in os.listdir(STATIC_PATH)]
167 dirs = filter(os.path.isdir, files)
168 routes = [web.static(prefix + os.path.basename(d), d) for d in dirs]
169 return routes
170
171
172def start_server(applications, port=0, host='', debug=False,

Callers 2

start_test_serverFunction · 0.90
start_serverFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…