我在程序目录中新建一个static目录,放入cs.txt文件
from bottle import static_file, route, run
@
route('/')
def hello():
return 'test'
@
route('/static/<filename>')
def server_static(filename):
return static_file(filename, root='./static')
run(host='localhost', port='8089')
已经弄好了,代码如上