【发布时间】:2015-11-26 01:52:34
【问题描述】:
我有一个静态文件的路由定义为
@bottle.route('/status/<filename>')
def server_static(filename):
root = os.path.join(os.path.dirname(__file__), 'status', 'public_html')
return bottle.static_file(filename, root=root)
当我调用http://localhost/status/index.html(或任何其他文件)时,它工作正常。
有没有办法在调用http://localhost/status时默认服务index.html?这相当于Apache中的DirectoryIndex或nginx中的index。
【问题讨论】: