这是一个典型的、最小的 bottle
Web 服务器示例
from bottle import route, run, template
@route('/hello/<name>')
def index(name):
return template('<b>Hello {{name}}</b>!', name=name)
run(host='localhost', port=8080)
如何查明 run
是否已成功启动 bottle
服务器实例以及服务器是否已准备好接收传入的 http 调用?
最佳答案
使用网络浏览器,尝试浏览到http://localhost:8080/hello/Anthony
。如果您使用的是 Linux,请尝试 wget http://localhost:8080/hello/Anthony
。
关于python - 如何判断Bottle服务器是否启动成功?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22144689/