获取用于提供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='/')
| 157 | |
| 158 | |
| 159 | def 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 | |
| 172 | def start_server(applications, port=0, host='', debug=False, |
no outgoing calls
no test coverage detected
searching dependent graphs…